summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 04:09:23 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 04:09:23 +0000
commit31482b2c6b0936b0b999eb2e001e5613f721745a (patch)
treeef75d08e4e5c6514327933dfd43d1d819295cc77 /source3/lib
parent5183aada246122540d6ed453f7f384cd2ebb0821 (diff)
downloadsamba-31482b2c6b0936b0b999eb2e001e5613f721745a.tar.gz
samba-31482b2c6b0936b0b999eb2e001e5613f721745a.tar.bz2
samba-31482b2c6b0936b0b999eb2e001e5613f721745a.zip
fix some undefined behaviour with increments in C. In theory a
compiler could have produced complete crap for this code. (This used to be commit 0e90da0810b60dd1c2b1ec46c1a2993856b919d3)
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 2224a24ab3..3c34df6f33 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;