summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index f6d9f3425f..f97cd3cc25 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -547,10 +547,11 @@ _PUBLIC_ void strupper_m(char *s)
Convert a string to upper case.
**/
-void strupper_m(char *s)
+bool strupper_m(char *s)
{
size_t len;
int errno_save;
+ bool ret = false;
/* this is quite a common operation, so we want it to be
fast. We optimise for the ascii case, knowing that all our
@@ -563,18 +564,21 @@ void strupper_m(char *s)
}
if (!*s)
- return;
+ return true;
/* I assume that lowercased string takes the same number of bytes
* as source string even in multibyte encoding. (VIV) */
len = strlen(s) + 1;
errno_save = errno;
errno = 0;
- unix_strupper(s,len,s,len);
+ ret = unix_strupper(s,len,s,len);
/* Catch mb conversion errors that may not terminate. */
- if (errno)
+ if (errno) {
s[len-1] = '\0';
+ ret = false;
+ }
errno = errno_save;
+ return ret;
}
/**