diff options
Diffstat (limited to 'src/error.cc')
-rw-r--r-- | src/error.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/error.cc b/src/error.cc index 34c8e33..d1d351d 100644 --- a/src/error.cc +++ b/src/error.cc @@ -66,12 +66,11 @@ void Error::pushError(char *fmt, ...) char buf[1024]; pthread_mutex_lock(&mutex); + // Beginning of safezone va_list argp; va_start(argp, fmt); - fprintf(stderr, "New Error: ["); - vfprintf(stderr, fmt, argp); - fprintf(stderr, "]\n"); fflush(stderr); + fprintf(stderr, "New Error: ["); vfprintf(stderr, fmt, argp); fprintf(stderr, "]\n"); fflush(stderr); vsprintf(buf, fmt, argp); va_end(argp); @@ -80,6 +79,8 @@ void Error::pushError(char *fmt, ...) err->errstr = string(buf); err->prev = lastError; lastError = err; + + // End of safezone pthread_mutex_unlock(&mutex); } |