diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-05-16 05:30:52 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-05-16 05:30:52 +0000 |
commit | 22c3e557283950e9ba8afb403c83e93dbeab6a3b (patch) | |
tree | 9b5c141c29ce4f9039ae69d5f41e3df5647d75f3 /i18n | |
parent | 55f05d65e92ff3f1e83b9e5af5b9bb6a0a888db5 (diff) | |
download | libapr-22c3e557283950e9ba8afb403c83e93dbeab6a3b.tar.gz |
Sing, "we are apr"... and make all hash functions accept apr_ssize_t
if we are going to bury -1 flags (I'd prefer the flag cast to apr_size_t
and use that value throughout the hash api, however.)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'i18n')
-rw-r--r-- | i18n/unix/utf8_ucs2.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index 68336c654..15cb411a5 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -102,7 +102,8 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, apr_wchar_t *out, apr_size_t *outwords) { apr_int64_t newch, mask; - int ch, expect, eating; + apr_size_t expect, eating; + int ch; while (*inbytes && *outwords) { @@ -167,7 +168,10 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, return APR_EINVAL; } } - if (*outwords < (expect > 2) + 1) + /* Where the boolean (expect > 2) is true, we will need + * an extra word for the output. + */ + if (*outwords < (apr_size_t)(expect > 2) + 1) break; /* buffer full */ while (expect--) { @@ -207,8 +211,9 @@ apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, char *out, apr_size_t *outbytes) { apr_int64_t newch, require; + apr_size_t need; char *invout; - int ch, need; + int ch; while (*inwords && *outbytes) { |