From c6d86fcffbeafa34fee7138c9942b02dc358377b Mon Sep 17 00:00:00 2001 From: David Lam Date: Tue, 4 Oct 2016 18:51:20 -0700 Subject: [PATCH] Fix error messages to not truncate to 255 characters --- src/gflags.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gflags.cc b/src/gflags.cc index 2c9e653..fe5300f 100644 --- a/src/gflags.cc +++ b/src/gflags.cc @@ -171,12 +171,10 @@ enum DieWhenReporting { DIE, DO_NOT_DIE }; // Report Error and exit if requested. static void ReportError(DieWhenReporting should_die, const char* format, ...) { - char error_message[255]; va_list ap; va_start(ap, format); - vsnprintf(error_message, sizeof(error_message), format, ap); + vfprintf(stderr, format, ap); va_end(ap); - fprintf(stderr, "%s", error_message); fflush(stderr); // should be unnecessary, but cygwin's rxvt buffers stderr if (should_die == DIE) gflags_exitfunc(1); }