$Log$
+ Revision 573.60 2000/12/30 04:55:05 ajc
+ * more buffer size stuff
+
Revision 573.59 2000/12/27 20:19:51 ajc
* The size constant "256" which shows up everywhere as a buffer size has now
been changed to SIZ. And, SIZ has been defined now as 1024, not 256, because
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
*/
for (i = 0;; i++) {
serv_read(&buf[i], 1);
- if (buf[i] == '\n' || i == 255)
+ if (buf[i] == '\n' || i == (SIZ-1))
break;
}
/* If we got a long line, discard characters until the newline.
*/
- if (i == 255)
+ if (i == (SIZ-1))
while (buf[i] != '\n')
serv_read(&buf[i], 1);
}
cprintf("%d %s\n",LISTING_FOLLOWS,buf);
- while (fgets(buf,255,mfp)!=NULL) {
+ while (fgets(buf, (SIZ-1), mfp)!=NULL) {
buf[strlen(buf)-1] = 0;
do_help_subst(buf);
cprintf("%s\n",buf);
*/
for (i = 0;; i++) {
if (sock_read(sock, &buf[i], 1) < 0) return(-1);
- if (buf[i] == '\n' || i == 255)
+ if (buf[i] == '\n' || i == (SIZ-1))
break;
}
/* If we got a long line, discard characters until the newline.
*/
- if (i == 255)
+ if (i == (SIZ-1))
while (buf[i] != '\n')
if (sock_read(sock, &buf[i], 1) < 0) return(-1);
if ( (!strncasecmp(buffer, "http://", 7))
|| (!strncasecmp(buffer, "ftp://", 6)) ) {
- safestrncpy(urls[num_urls], buffer, 255);
+ safestrncpy(urls[num_urls], buffer, (SIZ-1));
for (a=0; a<strlen(urls[num_urls]); ++a) {
b = urls[num_urls][a];
if ( (b==' ') || (b==')') || (b=='>') || (b==10)
*/
for (i = 0;; i++) {
serv_read(&buf[i], 1);
- if (buf[i] == '\n' || i == 255)
+ if (buf[i] == '\n' || i == (SIZ-1))
break;
}
/* If we got a long line, discard characters until the newline.
*/
- if (i == 255)
+ if (i == (SIZ-1))
while (buf[i] != '\n')
serv_read(&buf[i], 1);
if (is_valid_message(msg) == 0) return;
- for (i = 0; i < SIZ; ++i)
+ for (i = 0; i < 256; ++i)
if (msg->cm_fields[i] != NULL) {
phree(msg->cm_fields[i]);
}
strcpy(lnode, HUMANNODE);
if (mode == MT_RFC822) {
cprintf("X-UIDL: %ld%s", msg_num, nl);
- for (i = 0; i < SIZ; ++i) {
+ for (i = 0; i < 256; ++i) {
if (TheMessage->cm_fields[i]) {
mptr = TheMessage->cm_fields[i];
strcpy(newnn->nn_nodename, nodename);
newnn->nn_first = NULL;
- fgets(buf, 255, fp);
+ fgets(buf, (SIZ-1), fp);
buf[strlen(buf)-1] = 0;
strcpy(newnn->nn_spoolcmd, buf);
- while (fgets(buf, 255, fp) != NULL) {
+ while (fgets(buf, (SIZ-1), fp) != NULL) {
newrs = (struct roomshare *) malloc(sizeof(struct roomshare));
newrs->next = newnn->nn_first;
newnn->nn_first = newrs;
buf[strlen(buf)-1] = 0;
strcpy(newrs->rs_name, buf);
- fgets(buf, 255, fp);
+ fgets(buf, (SIZ-1), fp);
buf[strlen(buf)-1] = 0;
newrs->rs_lastsent = atol(buf);
}
exit(errno);
}
- while (fgets(buf, 255, ls) != NULL) {
+ while (fgets(buf, (SIZ-1), ls) != NULL) {
printf("%s", buf);
}
exit(3);
}
- fgets(buf, 255, fp); /* skip past spool cmd */
- while (fgets(buf, 255, fp) != NULL) {
+ fgets(buf, (SIZ-1), fp); /* skip past spool cmd */
+ while (fgets(buf, (SIZ-1), fp) != NULL) {
printf("%s", buf);
- fgets(buf, 255, fp); /* skip past last-sent pointer */
+ fgets(buf, (SIZ-1), fp); /* skip past last-sent pointer */
}
fclose(fp);
exit(3);
}
- fgets(buf, 255, fp);
+ fgets(buf, (SIZ-1), fp);
printf("%s", buf);
fclose(fp);
}
exit(4);
}
- strncpy(nnptr->nn_spoolcmd, spoolcmd, 255);
+ strncpy(nnptr->nn_spoolcmd, spoolcmd, (SIZ-1));
save_node(nnptr);
}
}
fp=fopen(temp,"r");
- while (fgets(cmd,255,fp)!=NULL) {
+ while (fgets(cmd,SIZ-1,fp)!=NULL) {
cmd[strlen(cmd)-1] = 0;
serv_puts(cmd);
}
}
} else if (buf[0] == '4') {
do {
- if (fgets(buf, 255, stdin) == NULL)
+ if (fgets(buf, sizeof buf, stdin) == NULL)
strcpy(buf, "000");
if (strlen(buf) > 0)
if (buf[strlen(buf) - 1] == '\n')
}
cprintf("%d\n",LISTING_FOLLOWS);
- while (fgets(buf,255,ls)!=NULL)
+ while (fgets(buf,sizeof buf,ls)!=NULL)
if (getuserbynumber(&usbuf,atol(buf))==0)
cprintf("%s\n",usbuf.fullname);
pclose(ls);
sprintf(buf,"cd %s; exec ls",dirs[a]);
ls = (FILE *) popen(buf,"r");
if (ls != NULL) {
- while(fgets(buf,255,ls)!=NULL) {
+ while(fgets(buf,sizeof buf,ls)!=NULL) {
while (isspace(buf[strlen(buf)-1]))
buf[strlen(buf)-1] = 0;
if (!strcasecmp(buf,searchfor)) {
*/
for (i = 0;;i++) {
retval = client_read(&buf[i], 1);
- if (retval != 1 || buf[i] == '\n' || i == 255)
+ if (retval != 1 || buf[i] == '\n' || i == (SIZ-1))
break;
}
/* If we got a long line, discard characters until the newline.
*/
- if (i == 255)
+ if (i == (SIZ-1))
while (buf[i] != '\n' && retval == 1)
retval = client_read(&buf[i], 1);