From a42b36f111a9104507dc32fabaa2a0b233ee9200 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 9 Jan 2009 18:18:53 +0000 Subject: [PATCH] Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8348 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/lib/berrno.c | 3 ++- bacula/src/lib/berrno.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.39.5