summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/doserr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/libsmb/doserr.c b/source3/libsmb/doserr.c
index b8cb8b4bc6..478b87d730 100644
--- a/source3/libsmb/doserr.c
+++ b/source3/libsmb/doserr.c
@@ -94,11 +94,9 @@ werror_code_struct dos_errs[] =
const char *dos_errstr(WERROR werror)
{
- static pstring msg;
+ char *result;
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))
@@ -106,7 +104,10 @@ const char *dos_errstr(WERROR werror)
idx++;
}
- return msg;
+ result = talloc_asprintf(talloc_tos(), "DOS code 0x%08x",
+ W_ERROR_V(werror));
+ SMB_ASSERT(result != NULL);
+ return result;
}
/* compat function for samba4 */