libc.obj:

strtol.с  - removed existing definitions;
fgets.c - uses fread() to read;
gets.c  - added additional check;

git-svn-id: svn://kolibrios.org@9081 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2021-07-24 21:28:39 +00:00
parent 2976cecf4e
commit 8fa851ddb6
3 changed files with 8 additions and 15 deletions

View File

@@ -11,14 +11,8 @@ char *fgets(char *str, int n, FILE *stream)
return NULL;
}
while (i<n-1){
sym_code = fgetc(stream);
if(sym_code =='\n' || sym_code == EOF){ break; }
str[i]=(char)sym_code;
i++;
}
i = fread(str, n-1, sizeof(char), stream);
if(i<1){ return NULL; }
return str;
}