diff options
author | Peter Wemm <peter@FreeBSD.org> | 2015-10-12 08:54:49 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2015-10-12 08:54:49 +0000 |
commit | dc5d469d6574e9fb03bdd793658bb371315b306a (patch) | |
tree | 013c2e6845398e5a9ca4901dcc077769c7520e1d /subversion/libsvn_subr/utf_validate.c | |
parent | 58218291fa73a17020ef0447398e9e8a78f9e8c7 (diff) |
Notes
Diffstat (limited to 'subversion/libsvn_subr/utf_validate.c')
-rw-r--r-- | subversion/libsvn_subr/utf_validate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subversion/libsvn_subr/utf_validate.c b/subversion/libsvn_subr/utf_validate.c index 8311fd71afd8e..90e529e2ffb2c 100644 --- a/subversion/libsvn_subr/utf_validate.c +++ b/subversion/libsvn_subr/utf_validate.c @@ -271,7 +271,7 @@ first_non_fsm_start_char(const char *data, apr_size_t max_len) max_len -= len; for (; len > 0; ++data, --len) - if (*data < 0 || *data >= 0x80) + if ((unsigned char)*data >= 0x80) return data; } @@ -285,7 +285,7 @@ first_non_fsm_start_char(const char *data, apr_size_t max_len) /* The remaining odd bytes will be examined the naive way: */ for (; max_len > 0; ++data, --max_len) - if (*data < 0 || *data >= 0x80) + if ((unsigned char)*data >= 0x80) break; return data; @@ -304,12 +304,12 @@ first_non_fsm_start_char_cstring(const char *data) * segfault. */ for (; (apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1); ++data) - if (*data <= 0 || *data >= 0x80) + if (*data == 0 || (unsigned char)*data >= 0x80) return data; /* Scan the input one machine word at a time. */ #ifndef SVN_UTF_NO_UNINITIALISED_ACCESS - /* This may read allocated but initialised bytes beyond the + /* This may read allocated but uninitialised bytes beyond the terminating null. Any such bytes are always readable and this code operates correctly whatever the uninitialised values happen to be. However memory checking tools such as valgrind and GCC @@ -331,7 +331,7 @@ first_non_fsm_start_char_cstring(const char *data) /* The remaining odd bytes will be examined the naive way: */ for (; ; ++data) - if (*data <= 0 || *data >= 0x80) + if (*data == 0 || (unsigned char)*data >= 0x80) break; return data; |