summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-01-17 06:40:12 +0000
committerJeremy Allison <jra@samba.org>2003-01-17 06:40:12 +0000
commitff8ca2f88ba8835c271aa099ad9ff334c992407d (patch)
tree905585d0a4bc1c1288d9f3955baec7111c4592cd
parent2b79854f068c99b2881a02371b4bc7dd00a4e5aa (diff)
downloadsamba-ff8ca2f88ba8835c271aa099ad9ff334c992407d.tar.gz
samba-ff8ca2f88ba8835c271aa099ad9ff334c992407d.tar.bz2
samba-ff8ca2f88ba8835c271aa099ad9ff334c992407d.zip
Janitorial duty...
fix some undefined behaviour with increments in C. In theory a compiler could have produced complete crap for this code. (tridge). Jeremy. (This used to be commit 2b4335f06265940582f389f48dc4f87f452a2703)
-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 148181fddd..799bc64cc6 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1037,8 +1037,10 @@ void strlower_m(char *s)
supported multi-byte character sets are ascii-compatible
(ie. they match for the first 128 chars) */
- while (*s && !(((unsigned char)s[0]) & 0x7F))
- *s++ = tolower((unsigned char)*s);
+ while (*s && !(((unsigned char)s[0]) & 0x7F)) {
+ *s = tolower((unsigned char)*s);
+ s++;
+ }
if (!*s)
return;
@@ -1074,8 +1076,10 @@ void strupper_m(char *s)
supported multi-byte character sets are ascii-compatible
(ie. they match for the first 128 chars) */
- while (*s && !(((unsigned char)s[0]) & 0x7F))
- *s++ = toupper((unsigned char)*s);
+ while (*s && !(((unsigned char)s[0]) & 0x7F)) {
+ *s = toupper((unsigned char)*s);
+ s++;
+ }
if (!*s)
return;