From cce68f0c9c5d054017425e6e6fd54f696d36e8ee Mon Sep 17 00:00:00 2001 From: David Lam Date: Wed, 5 Oct 2016 00:25:50 -0700 Subject: [PATCH] Fix error messages to not truncate to 255 characters (#175) --- 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); }