summaryrefslogtreecommitdiff
path: root/src/basic/string-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-20 15:22:29 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitb8d5382d4ac59dc34da998aaa4077d8435169a8f (patch)
tree51d6aedaf49b72d56a431786320c09c196e9c625 /src/basic/string-util.c
parent044eac165bdf48b010bceb1038d7b1f7ce732988 (diff)
string-util: use fflush_and_check() where appropriate
Diffstat (limited to 'src/basic/string-util.c')
-rw-r--r--src/basic/string-util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index d3d9d3044..498e31122 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) {
@@ -798,7 +799,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);
}