diff options
author | David Lam <dylam07@gmail.com> | 2016-10-05 00:25:50 -0700 |
---|---|---|
committer | Andreas Schuh <andreas.schuh.84@gmail.com> | 2016-10-05 08:25:50 +0100 |
commit | cce68f0c9c5d054017425e6e6fd54f696d36e8ee (patch) | |
tree | 0dc8b56aa105476a0e4673a673e8c715c77eee5b | |
parent | f4eace133187e0a101a6d6d71c55592b572de189 (diff) | |
download | gflags-cce68f0c9c5d054017425e6e6fd54f696d36e8ee.tar.gz gflags-cce68f0c9c5d054017425e6e6fd54f696d36e8ee.tar.bz2 gflags-cce68f0c9c5d054017425e6e6fd54f696d36e8ee.zip |
Fix error messages to not truncate to 255 characters (#175)
-rw-r--r-- | src/gflags.cc | 4 |
1 files changed, 1 insertions, 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); } |