diff options
author | waker <wakeroid@gmail.com> | 2011-02-07 22:20:35 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-07 22:20:35 +0100 |
commit | 38e883f1fbc97fc33a01af93cd0a82f971390b51 (patch) | |
tree | 5ee065eb2a69f4d19473a49de605bb5c4d4460dd /utf8.c | |
parent | 083e9b711cdd5f255e09dfb040a9fd93e97c1774 (diff) |
fixed junklib utf8 validation
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -590,14 +590,13 @@ int u8_valid (const char *str, /* See that we covered the entire length if a length was * passed in, or that we ended on a nul if not */ - if (max_len >= 0 && - p != (str + max_len)) + if (max_len >= 0 && p != (str + max_len) && *p != 0) { return 0; - else if (max_len < 0 && - *p != '\0') + } + else if (max_len < 0 && *p != '\0') { return 0; - else - return 1; + } + return 1; } #if 0 |