From: Kern Sibbald Date: Fri, 9 Jan 2009 18:18:53 +0000 (+0000) Subject: Update X-Git-Tag: Release-3.0.0~328 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=56412851663d7407e6853e7c7ad2474c77eccf98;p=bacula%2Fbacula Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8348 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/berrno.c b/bacula/src/lib/berrno.c index b7669efd65..3f55807e75 100644 --- a/bacula/src/lib/berrno.c +++ b/bacula/src/lib/berrno.c @@ -49,6 +49,7 @@ extern int execvp_errors[]; const char *berrno::bstrerror() { + *m_buf = 0; #ifdef HAVE_WIN32 if (m_berrno & b_errno_win32) { format_win32_message(); @@ -93,7 +94,7 @@ void berrno::format_win32_message() { #ifdef HAVE_WIN32 LPVOID msg; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), diff --git a/bacula/src/lib/berrno.h b/bacula/src/lib/berrno.h index ee392ea549..eb4253de7c 100644 --- a/bacula/src/lib/berrno.h +++ b/bacula/src/lib/berrno.h @@ -75,6 +75,7 @@ inline berrno::berrno(int pool) { m_berrno = errno; m_buf = get_pool_memory(pool); + *m_buf = 0; errno = m_berrno; }