From 1f6e456fc2be394bf5b345f10ca5b3e0e23febb1 Mon Sep 17 00:00:00 2001 From: Andrew Hsu Date: Thu, 10 Nov 2016 16:24:41 -0800 Subject: [PATCH] handle return val of fwrite() to pacify compiler warn Signed-off-by: Andrew Hsu Signed-off-by: Michael Crosby --- src/tini.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tini.c b/src/tini.c index 267a0de..96ce427 100644 --- a/src/tini.c +++ b/src/tini.c @@ -208,10 +208,15 @@ void print_usage(char* const name, FILE* const file) { } void print_license(FILE* const file) { - fwrite(LICENSE, sizeof(char), LICENSE_len, file); + if(LICENSE_len > fwrite(LICENSE, sizeof(char), LICENSE_len, file)) { + // Don't handle this error for now, since parse_args won't care + // about the return value. We do need to check it to compile with + // older glibc, though. + // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 + // See: http://sourceware.org/bugzilla/show_bug.cgi?id=11959 + } } - int parse_args(const int argc, char* const argv[], char* (**child_args_ptr_ptr)[], int* const parse_fail_exitcode_ptr) { char* name = argv[0];