summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2023-02-28 20:53:59 +0100
committerJeremy Allison <jra@samba.org>2023-03-09 18:10:33 +0000
commit43b34b015979fd250171b7610db7d55f6b2ac7cf (patch)
treef6fa5c2bad16784f3b28bd4d5e041bb812c543b3 /libcli
parente6a03c04a765e4d6c41b137d365a1e64f6285a8e (diff)
downloadsamba-43b34b015979fd250171b7610db7d55f6b2ac7cf.tar.gz
libcli: Shrink .data segment by 43264 bytes
A case statement only references const strings, pointers in an array need to be relocated at exec() time. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/util/doserr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libcli/util/doserr.c b/libcli/util/doserr.c
index 28f709e0739..b9553dfac5e 100644
--- a/libcli/util/doserr.c
+++ b/libcli/util/doserr.c
@@ -32,8 +32,6 @@ struct werror_str_struct {
const char *friendly_errstr;
};
-#include "werror_gen.c"
-
static const struct werror_code_struct special_errs[] =
{
{ "WERR_DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD", WERR_DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD },
@@ -108,11 +106,10 @@ const char *win_errstr(WERROR werror)
idx = 0;
- while (dos_errs[idx].dos_errstr != NULL) {
- if (W_ERROR_V(dos_errs[idx].werror) ==
- W_ERROR_V(werror))
- return dos_errs[idx].dos_errstr;
- idx++;
+ switch W_ERROR_V(werror) {
+#include "werror_gen.c"
+ default:
+ break;
}
slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));