int teles;
int size;
unsigned int nbytes;
- s_char buf[4096]; /* buf is message text */
+ char buf[1024];
+ char msgbuf[4096]; /* message text */
int lasttype;
int lastcnum;
time_t lastdate;
skip:
while (tgm.tel_length > 0) {
nbytes = tgm.tel_length;
- if (nbytes > sizeof(buf) - 1)
- nbytes = sizeof(buf) - 1;
- (void)fread(buf, sizeof(s_char), nbytes, telfp);
- buf[nbytes] = 0;
+ if (nbytes > sizeof(msgbuf) - 1)
+ nbytes = sizeof(msgbuf) - 1;
+ (void)fread(msgbuf, sizeof(s_char), nbytes, telfp);
+ msgbuf[nbytes] = 0;
if (readit)
- uprnf(buf);
+ uprnf(msgbuf);
tgm.tel_length -= nbytes;
}
}
FILE *fptr;
struct telstr tgm;
char *p;
- char buf[MAXTELSIZE + 1];
+ char buf[1024];
+ char msgbuf[MAXTELSIZE + 1]; /* message text */
char *msgfilepath;
p = getstarg(player->argp[1], "on, off or motd? ", buf);
pr("Enter a new message of the day.\n");
time(&tgm.tel_date);
- tgm.tel_length = getele("The World", buf);
+ tgm.tel_length = getele("The World", msgbuf);
if (tgm.tel_length < 0) {
pr("Ignored\n");
pr("Logins disabled.\n");
if ((fwrite(&tgm, sizeof(tgm), 1, fptr) != 1) ||
- (fwrite(buf, tgm.tel_length, 1, fptr) != 1)) {
+ (fwrite(msgbuf, tgm.tel_length, 1, fptr) != 1)) {
fclose(fptr);
pr("Something went wrong writing the message file.\n");
logerror("Could not properly write message file (%s).\n",