extern void strbuf_reserve(strbuf_t *, int);
extern void strbuf_empty(strbuf_t *);
extern void strbuf_nl_to_crlf(strbuf_t *);
-extern char *nonconst(const char *, char *, size_t);
extern int swapbits(int, int, int);
extern void shuffle_int_array(int *, int);
/* note: the snprintf CPP wrapper includes the "fmt" argument in "..."
void strbuf_reserve (strbuf *, int)
void strbuf_empty (strbuf *)
void strbuf_nl_to_crlf (strbuf_t *)
- char * nonconst (const char *, char *)
int swapbits (int, int, int)
void shuffle_int_array (int *, int)
void nh_snprintf (const char *, int, char *, size_t,
}
}
-char *
-nonconst(const char *str, char *buf, size_t bufsz)
-{
- char *retval = emptystr;
-
- if (str && buf)
- if (strlen(str) <= (bufsz - 1)) {
- Strcpy(buf, str);
- retval = buf;
- }
- return retval;
-}
-
/* swapbits(val, bita, bitb) swaps bit a with bit b in val */
int
swapbits(int val, int bita, int bitb)
static boolean md_rush(struct monst *, int, int);
static void newmail(struct mail_info *);
#if defined(SIMPLE_MAIL) || defined(SERVER_ADMIN_MSG)
-static void read_simplemail(char *mbox, boolean adminmsg);
+static void read_simplemail(const char *mbox, boolean adminmsg);
#endif
#if !defined(UNIX) && !defined(VMS)
#if defined(SIMPLE_MAIL) || defined(SERVER_ADMIN_MSG)
void
-read_simplemail(char *mbox, boolean adminmsg)
+read_simplemail(const char *mbox, boolean adminmsg)
{
FILE* mb = fopen(mbox, "r");
char curline[128], *msg;
#ifdef SERVER_ADMIN_MSG
static struct stat ost,nst;
static long lastchk = 0;
- char adminbuf[BUFSZ];
if (g.moves < lastchk + SERVER_ADMIN_MSG_CKFREQ) return;
lastchk = g.moves;
if (!stat(SERVER_ADMIN_MSG, &nst)) {
if (nst.st_mtime > ost.st_mtime)
- read_simplemail(nonconst(SERVER_ADMIN_MSG, adminbuf,
- sizeof adminbuf), TRUE);
+ read_simplemail(SERVER_ADMIN_MSG, TRUE);
ost.st_mtime = nst.st_mtime;
}
#endif /* SERVER_ADMIN_MSG */