summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-string.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-11-22 19:20:29 +0000
committerHavoc Pennington <hp@redhat.com>2004-11-22 19:20:29 +0000
commit25c1f310aafc8b3d89ee19656a64244e6f108dbb (patch)
treee5066ecd1e0875a2f77de2b8ce410703d03fcb3f /dbus/dbus-string.c
parent1b1dfafc344ad7b60b8156a1bbdbfc1b364bfa98 (diff)
2004-11-22 Havoc Pennington <hp@redhat.com>
* test/glib/test-profile.c (N_CLIENT_THREADS): run multiple threads for more time, so sysprof can get a grip on it. * dbus/dbus-string.c (_dbus_string_validate_utf8): remove pointless variable
Diffstat (limited to 'dbus/dbus-string.c')
-rw-r--r--dbus/dbus-string.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
index 75d22103..1611ff02 100644
--- a/dbus/dbus-string.c
+++ b/dbus/dbus-string.c
@@ -2444,24 +2444,23 @@ _dbus_string_validate_utf8 (const DBusString *str,
int i, mask, char_len;
dbus_unichar_t result;
- const unsigned char c = (unsigned char) *p;
-
- if (c == 0) /* nul bytes not OK */
+ /* nul bytes considered invalid */
+ if (*p == '\0')
break;
/* Special-case ASCII; this makes us go a lot faster in
* D-BUS profiles where we are typically validating
* function names and such. We have to know that
* all following checks will pass for ASCII though,
- * comments follow ...
- */
- if (c < 128)
+ * comments follow ...
+ */
+ if (*p < 128)
{
++p;
continue;
}
- UTF8_COMPUTE (c, mask, char_len);
+ UTF8_COMPUTE (*p, mask, char_len);
if (_DBUS_UNLIKELY (char_len == 0)) /* ASCII: char_len == 1 */
break;