creds: minor tweak for fputc() error handling
Let's do not assume errno is set for return values other than EOF, following what we do in fileio.c.
This commit is contained in:
+1
-1
@@ -416,7 +416,7 @@ static int print_newline(FILE *f, const char *data, size_t l) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fputc('\n', f) != '\n')
|
||||
if (fputc('\n', f) == EOF)
|
||||
return log_error_errno(errno, "Failed to write trailing newline: %m");
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user