From: Nathan Bryant Date: Tue, 12 Mar 2002 03:36:55 +0000 (+0000) Subject: replace calls to gets with fgets X-Git-Tag: v7.86~6489 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=3b38c113357ff974ea52f62c50767d6158098d4d replace calls to gets with fgets --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 87fd837c5..849fe7052 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 590.142 2002/03/12 03:36:55 nbryant + replace calls to gets with fgets + Revision 590.141 2002/03/12 03:19:09 nbryant more sprintf bashing. now the only ones left are in mime_parser @@ -3444,3 +3447,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/migratenet.c b/citadel/migratenet.c index 1ecf2c1e7..3717f83a9 100644 --- a/citadel/migratenet.c +++ b/citadel/migratenet.c @@ -56,7 +56,7 @@ int main(int argc, char **argv) "ERASE any 5.90 configuration files that you have already set up.\n\n" "Are you sure you want to do this? "); - gets(buf); + fgets(buf, sizeof buf, stdin); if (tolower(buf[0]) != 'y') exit(0); get_config(); @@ -112,16 +112,16 @@ int main(int argc, char **argv) fprintf(nodefp, "%s|", d->d_name); printf("Enter shared secret: "); - gets(buf); + fgets(buf, sizeof buf, stdin); if (buf[0] == 0) strcpy(buf, config.c_net_password); fprintf(nodefp, "%s|", buf); printf("Enter host name/IP : "); - gets(buf); + fgets(buf, sizeof buf, stdin); if (buf[0] == 0) snprintf(buf, sizeof buf, "%s.citadel.org", d->d_name); fprintf(nodefp, "%s|", buf); printf("Enter port number : "); - gets(buf); + fgets(buf, sizeof buf, stdin); if (buf[0] == 0) strcpy(buf, "504"); fprintf(nodefp, "%s\n", buf); @@ -239,7 +239,7 @@ roomerror: /* free this record */ "old network configuration files. Delete them now? " ); - gets(buf); + fgets(buf, sizeof buf, stdin); if (tolower(buf[0]) != 'y') exit(0); get_config(); diff --git a/citadel/parsedate.y b/citadel/parsedate.y index 776781bbb..bf69da311 100644 --- a/citadel/parsedate.y +++ b/citadel/parsedate.y @@ -799,7 +799,7 @@ main(int ac, char *av[]) for ( ; ; ) { (void)printf("\t> "); (void)fflush(stdout); - if (gets(buff) == NULL || buff[0] == '\n') + if (fgets(buff, sizeof buff, stdin) == NULL || buff[0] == '\n') break; #if YYDEBUG if (strcmp(buff, "yydebug") == 0) {