summaryrefslogtreecommitdiffstats
path: root/source/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
commit0e90da0810b60dd1c2b1ec46c1a2993856b919d3 (patch)
treecd0dae064a9c7893d4f78172d948d54c992dff11 /source/lib
parenta1c790b5ea8de120a1d8710ac190955aea28246f (diff)
downloadsamba-0e90da0810b60dd1c2b1ec46c1a2993856b919d3.tar.gz
samba-0e90da0810b60dd1c2b1ec46c1a2993856b919d3.tar.xz
samba-0e90da0810b60dd1c2b1ec46c1a2993856b919d3.zip
fix some undefined behaviour with increments in C. In theory a
compiler could have produced complete crap for this code.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util_str.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index 2224a24ab31..3c34df6f339 100644
--- a/source/lib/util_str.c
+++ b/source/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;