diff options
Diffstat (limited to 'source4/lib/charset')
-rw-r--r-- | source4/lib/charset/charset.h | 2 | ||||
-rw-r--r-- | source4/lib/charset/iconv.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source4/lib/charset/charset.h b/source4/lib/charset/charset.h index 3c548192b6..6943a60182 100644 --- a/source4/lib/charset/charset.h +++ b/source4/lib/charset/charset.h @@ -21,7 +21,7 @@ #ifndef __CHARSET_H__ #define __CHARSET_H__ -#include "lib/talloc/talloc.h" +#include <talloc.h> /* this defines the charset types used in samba */ typedef enum {CH_UTF16=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4, CH_UTF16BE=5} charset_t; diff --git a/source4/lib/charset/iconv.c b/source4/lib/charset/iconv.c index 4eda585d4e..062b4ddfc8 100644 --- a/source4/lib/charset/iconv.c +++ b/source4/lib/charset/iconv.c @@ -72,23 +72,22 @@ static const struct charset_functions builtin_functions[] = { static struct charset_functions *charsets = NULL; -NTSTATUS charset_register_backend(const void *_funcs) +bool charset_register_backend(const void *_funcs) { struct charset_functions *funcs = memdup(_funcs,sizeof(struct charset_functions)); - struct charset_functions *c = charsets; + struct charset_functions *c; /* Check whether we already have this charset... */ - while(c) { - if(!strcasecmp(c->name, funcs->name)){ + for (c = charsets; c != NULL; c = c->next) { + if(!strcasecmp(c->name, funcs->name)) { DEBUG(2, ("Duplicate charset %s, not registering\n", funcs->name)); - return NT_STATUS_OBJECT_NAME_COLLISION; + return false; } - c = c->next; } funcs->next = funcs->prev = NULL; DLIST_ADD(charsets, funcs); - return NT_STATUS_OK; + return true; } #ifdef HAVE_NATIVE_ICONV |