r975: slight improvemet to nt_errstr(), still needs to be fixed properly
authorAndrew Tridgell <tridge@samba.org>
Wed, 2 Jun 2004 08:31:47 +0000 (08:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:24 +0000 (12:56 -0500)
(getting rid of the static buffer)
(This used to be commit 86a6236c2ad14fe94f5d7c488bfdbfb329d2a0bb)

source4/libcli/util/nterr.c

index 6c4b7c8417a2e8c25fec5123b666adbb42443006..c71dc2247b9b441023847746a2b3e0a3a9264b60 100644 (file)
@@ -646,8 +646,6 @@ const char *nt_errstr(NTSTATUS nt_code)
         static pstring msg;
         int idx = 0;
 
-       slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
-
        while (nt_errs[idx].nt_errstr != NULL) {
                if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
                     NT_STATUS_V(nt_code)) {
@@ -656,6 +654,8 @@ const char *nt_errstr(NTSTATUS nt_code)
                idx++;
        }
 
+       slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
+
         return msg;
 }