diff options
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/charset/util_str.c | 2 | ||||
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index 4f4ca93cfd..e76c1dbbf5 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -550,7 +550,7 @@ char *strstr_m(const char *src, const char *findstr) DEBUG(0,("strstr_m: dest malloc fail\n")); return NULL; } - retp = (char *)(s+strlen(s2)); + retp = discard_const_p(char, (s+strlen(s2))); TALLOC_FREE(src_w); TALLOC_FREE(find_w); TALLOC_FREE(s2); diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index 22f22ab754..5b61d52e7f 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -72,12 +72,12 @@ smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c) smb_ucs2_t cp; while (*(COPY_UCS2_CHAR(&cp,s))) { if (c == cp) { - return (smb_ucs2_t *)s; + return discard_const_p(smb_ucs2_t, s); } s++; } if (c == cp) { - return (smb_ucs2_t *)s; + return discard_const_p(smb_ucs2_t, s); } return NULL; @@ -104,7 +104,7 @@ smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c) p += (len - 1); do { if (c == *(COPY_UCS2_CHAR(&cp,p))) { - return (smb_ucs2_t *)p; + return discard_const_p(smb_ucs2_t, p); } } while (p-- != s); return NULL; |