Skip to content
Snippets Groups Projects
Commit b2151f34 authored by rob's avatar rob
Browse files

Improved use of fgets(), but still not echoing.

parent feffa78b
No related branches found
No related tags found
No related merge requests found
......@@ -766,7 +766,7 @@ int main(int argc, char** argv)
if((fp=fopen("/etc/resolv.conf","r"))!=NULL) {
while(!feof(fp)) {
if(fgets(str,sizeof(str),fp)==NULL)
if(fgets(str,sizeof(str)-1,fp)==NULL)
break;
truncsp(str);
p=str;
......@@ -1251,7 +1251,7 @@ int main(int argc, char** argv)
case 'd': /* down node */
case 'i': /* interrupt node */
printf("\nNode number: ");
if((n=atoi(fgets(str,3,stdin)))<1)
if((n=atoi(fgets(str,sizeof(str)-1,stdin)))<1)
break;
fflush(stdin);
printf("\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment