uname: Use fgets()
This commit is contained in:
parent
a1a1157151
commit
26324259f2
@ -9,16 +9,8 @@ int main()
|
||||
return 1;
|
||||
}
|
||||
|
||||
char buf[4096];
|
||||
size_t nread = fread(buf, sizeof(buf) - 1, 1, fp);
|
||||
|
||||
if (ferror(fp))
|
||||
{
|
||||
perror("fread");
|
||||
return 1;
|
||||
}
|
||||
|
||||
buf[nread] = 0; // null terminate it :)
|
||||
char buf[32];
|
||||
fgets(buf, sizeof(buf), fp);
|
||||
|
||||
printf("%s\n", buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user