diff options
author | Explorer09 <explorer09@gmail.com> | 2024-04-17 16:45:46 +0800 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2024-04-17 11:54:00 +0200 |
commit | a46b3f0a98c801b94df08598be0127e4d7db2aca (patch) | |
tree | 9a0e51e445dbb19685897d225ff847016f9c6761 /XUtils.c | |
parent | 6f0adfab242f40e0a0e82445abac4e574c7a97e8 (diff) |
Use 'fp' name for local 'FILE*' variables.
It is inappropriate to use the 'fd' name for 'FILE*' variables.
POSIX file descriptiors are of type 'int' and are distinguished from
ISO C stream pointers (type 'FILE*').
Rename these variables to 'fp', which is a preferred naming in POSIX.
(Note that ISO C preferred the 'stream' name for the variables.)
No code changes.
Diffstat (limited to 'XUtils.c')
-rw-r--r-- | XUtils.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -186,13 +186,13 @@ void String_freeArray(char** s) { free(s); } -char* String_readLine(FILE* fd) { +char* String_readLine(FILE* fp) { const size_t step = 1024; size_t bufSize = step; char* buffer = xMalloc(step + 1); char* at = buffer; for (;;) { - const char* ok = fgets(at, step + 1, fd); + const char* ok = fgets(at, step + 1, fp); if (!ok) { free(buffer); return NULL; @@ -202,7 +202,7 @@ char* String_readLine(FILE* fd) { *newLine = '\0'; return buffer; } else { - if (feof(fd)) { + if (feof(fp)) { return buffer; } } |