summaryrefslogtreecommitdiff
path: root/source4/libcli/util
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-30 05:33:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:25 -0500
commitf3d946646975cc04c5abd6b41adaf547175d6aab (patch)
tree3e7d21a51471ba7316f33a4c8d13a7a4e1cde98a /source4/libcli/util
parente64fce8b883a49a8ecb6f0e4d326d3b5f11d2282 (diff)
downloadsamba-f3d946646975cc04c5abd6b41adaf547175d6aab.tar.gz
samba-f3d946646975cc04c5abd6b41adaf547175d6aab.tar.bz2
samba-f3d946646975cc04c5abd6b41adaf547175d6aab.zip
r2102: fixed a race condition when handling dos errors that are in our
table. Should get rid of the static buffer completely at some point. (This used to be commit e0bda611121ed1f4afc2bfe83853e5521c494164)
Diffstat (limited to 'source4/libcli/util')
-rw-r--r--source4/libcli/util/doserr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source4/libcli/util/doserr.c b/source4/libcli/util/doserr.c
index c4ec869961..b8605864fc 100644
--- a/source4/libcli/util/doserr.c
+++ b/source4/libcli/util/doserr.c
@@ -22,13 +22,12 @@
#include "includes.h"
-typedef const struct
-{
+struct werror_code_struct {
const char *dos_errstr;
WERROR werror;
-} werror_code_struct;
+};
-werror_code_struct dos_errs[] =
+static const struct werror_code_struct dos_errs[] =
{
{ "WERR_OK", WERR_OK },
{ "WERR_BADFILE", WERR_BADFILE },
@@ -79,8 +78,6 @@ const char *win_errstr(WERROR werror)
static pstring msg;
int idx = 0;
- slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
-
while (dos_errs[idx].dos_errstr != NULL) {
if (W_ERROR_V(dos_errs[idx].werror) ==
W_ERROR_V(werror))
@@ -88,5 +85,7 @@ const char *win_errstr(WERROR werror)
idx++;
}
+ slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
+
return msg;
}