diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-04-20 15:22:29 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-04-24 15:58:31 +0200 |
commit | c7e03d2e679ca4fa197e863f532af0a48ec8675d (patch) | |
tree | 1f08602abad186e870340071f68eee1de0118c05 /src/basic/string-util.c | |
parent | 695a944c648ccb8d91a9a75b66340f01e7e557dd (diff) | |
download | systemd-c7e03d2e679ca4fa197e863f532af0a48ec8675d.tar.gz |
string-util: use fflush_and_check() where appropriate
Diffstat (limited to 'src/basic/string-util.c')
-rw-r--r-- | src/basic/string-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 41413b5fa4..07c9938a3f 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -21,6 +21,7 @@ #include "terminal-util.h" #include "utf8.h" #include "util.h" +#include "fileio.h" int strcmp_ptr(const char *a, const char *b) { @@ -794,7 +795,7 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) { } } - if (ferror(f)) { + if (fflush_and_check(f) < 0) { fclose(f); return mfree(obuf); } |