Commit cce68f0c authored by David Lam's avatar David Lam Committed by Andreas Schuh

Fix error messages to not truncate to 255 characters (#175)

parent f4eace13
...@@ -171,12 +171,10 @@ enum DieWhenReporting { DIE, DO_NOT_DIE }; ...@@ -171,12 +171,10 @@ enum DieWhenReporting { DIE, DO_NOT_DIE };
// Report Error and exit if requested. // Report Error and exit if requested.
static void ReportError(DieWhenReporting should_die, const char* format, ...) { static void ReportError(DieWhenReporting should_die, const char* format, ...) {
char error_message[255];
va_list ap; va_list ap;
va_start(ap, format); va_start(ap, format);
vsnprintf(error_message, sizeof(error_message), format, ap); vfprintf(stderr, format, ap);
va_end(ap); va_end(ap);
fprintf(stderr, "%s", error_message);
fflush(stderr); // should be unnecessary, but cygwin's rxvt buffers stderr fflush(stderr); // should be unnecessary, but cygwin's rxvt buffers stderr
if (should_die == DIE) gflags_exitfunc(1); if (should_die == DIE) gflags_exitfunc(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment