summaryrefslogtreecommitdiff
path: root/source4/lib/charset
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 13:27:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:41 -0500
commitdccf3f99e45137b6cd18c1de1c79808ad67130d1 (patch)
tree7c0f8e64f4ded3701818b8968171597eccd62267 /source4/lib/charset
parentffeee68e4b72dd94fee57366bd8d38b8c284c3d4 (diff)
downloadsamba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.tar.gz
samba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.tar.bz2
samba-dccf3f99e45137b6cd18c1de1c79808ad67130d1.zip
r25027: Fix more warnings.
(This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729)
Diffstat (limited to 'source4/lib/charset')
-rw-r--r--source4/lib/charset/charcnv.c6
-rw-r--r--source4/lib/charset/util_unistr.c12
2 files changed, 9 insertions, 9 deletions
diff --git a/source4/lib/charset/charcnv.c b/source4/lib/charset/charcnv.c
index dda9f754b1..ca96277679 100644
--- a/source4/lib/charset/charcnv.c
+++ b/source4/lib/charset/charcnv.c
@@ -152,7 +152,7 @@ _PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
smb_iconv_t descriptor;
if (srclen == (size_t)-1)
- srclen = strlen(src)+1;
+ srclen = strlen(inbuf)+1;
descriptor = get_conv_handle(from, to);
@@ -351,9 +351,9 @@ static ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t s
if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII)) {
if (src_len == (size_t)-1) {
- src_len = strlen(src) + 1;
+ src_len = strlen((const char *)src) + 1;
} else {
- size_t len = strnlen(src, src_len);
+ size_t len = strnlen((const char *)src, src_len);
if (len < src_len)
len++;
src_len = len;
diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c
index 6c86b0b899..e9cca090cc 100644
--- a/source4/lib/charset/util_unistr.c
+++ b/source4/lib/charset/util_unistr.c
@@ -393,7 +393,7 @@ _PUBLIC_ char *strchr_m(const char *s, char c)
size_t size;
codepoint_t c2 = next_codepoint(s, &size);
if (c2 == c) {
- return discard_const(s);
+ return discard_const_p(char, s);
}
s += size;
}
@@ -418,7 +418,7 @@ _PUBLIC_ char *strrchr_m(const char *s, char c)
size_t size;
codepoint_t c2 = next_codepoint(s, &size);
if (c2 == c) {
- ret = discard_const(s);
+ ret = discard_const_p(char, s);
}
s += size;
}
@@ -482,7 +482,7 @@ _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
- dest = talloc_size(ctx, 2*(strlen(src))+1);
+ dest = talloc_array(ctx, char, 2*(strlen(src))+1);
if (dest == NULL) {
return NULL;
}
@@ -505,7 +505,7 @@ _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
dest[size] = 0;
/* trim it so talloc_append_string() works */
- dest = talloc_realloc_size(ctx, dest, size+1);
+ dest = talloc_realloc(ctx, dest, char, size+1);
talloc_set_name_const(dest, dest);
@@ -526,7 +526,7 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
- dest = talloc_size(ctx, 2*(strlen(src))+1);
+ dest = talloc_array(ctx, char, 2*(strlen(src))+1);
if (dest == NULL) {
return NULL;
}
@@ -549,7 +549,7 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
dest[size] = 0;
/* trim it so talloc_append_string() works */
- dest = talloc_realloc_size(ctx, dest, size+1);
+ dest = talloc_realloc(ctx, dest, char, size+1);
talloc_set_name_const(dest, dest);