diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2024-04-13 12:59:10 +0200 |
---|---|---|
committer | Thomas Weißschuh <thomas@t-8ch.de> | 2024-04-13 13:04:36 +0200 |
commit | ccb3af024cb134acb391a44283dec4ed40c3605b (patch) | |
tree | 021fed74c3af5dfa4706583c51fbd127289ca113 | |
parent | ef4fd528cb6dcddb867df903355d8289e12a7206 (diff) | |
download | util-linux-ccb3af024cb134acb391a44283dec4ed40c3605b.tar.gz |
treewide: use fgetc() instead of getc()
fgetc() is similar to getc() but is guaranteed to be a function.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
-rw-r--r-- | login-utils/islocal.c | 2 | ||||
-rw-r--r-- | term-utils/agetty.c | 4 | ||||
-rw-r--r-- | text-utils/more.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/login-utils/islocal.c b/login-utils/islocal.c index ab5c52ed58..7d5541fd10 100644 --- a/login-utils/islocal.c +++ b/login-utils/islocal.c @@ -39,7 +39,7 @@ static int is_local_in_file(const char *user, const char *filename) match = 0u; skip = 0; - while ((chin = getc(f)) != EOF) { + while ((chin = fgetc(f)) != EOF) { if (skip) { /* Looking for the start of the next line. */ if ('\n' == chin) { diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 0fc6f15144..ff5123dbf6 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -1843,9 +1843,9 @@ static int issuefile_read_stream( ie->output = open_memstream(&ie->mem, &ie->mem_sz); } - while ((c = getc(f)) != EOF) { + while ((c = fgetc(f)) != EOF) { if (c == '\\') - output_special_char(ie, getc(f), op, tp, f); + output_special_char(ie, fgetc(f), op, tp, f); else putc(c, ie->output); } diff --git a/text-utils/more.c b/text-utils/more.c index 1badf67d55..4c22533185 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -379,7 +379,7 @@ static void more_fseek(struct more_control *ctl, off_t pos) static int more_getc(struct more_control *ctl) { - int ret = getc(ctl->current_file); + int ret = fgetc(ctl->current_file); ctl->file_position = ftello(ctl->current_file); return ret; } |