dovecot-2.0-pigeonhole: Enotify: mailto: fixed inappropriate ret...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Jan 19 18:37:50 EET 2011
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/8a07ae3e0a2e
changeset: 1459:8a07ae3e0a2e
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Jan 19 17:37:43 2011 +0100
description:
Enotify: mailto: fixed inappropriate return type in URI parse function, also fixing ARM compiler warning.
diffstat:
src/lib-sieve/plugins/enotify/mailto/uri-mailto.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diffs (44 lines):
diff -r 5b57b1142864 -r 8a07ae3e0a2e src/lib-sieve/plugins/enotify/mailto/uri-mailto.c
--- a/src/lib-sieve/plugins/enotify/mailto/uri-mailto.c Thu Jan 06 15:50:31 2011 +0100
+++ b/src/lib-sieve/plugins/enotify/mailto/uri-mailto.c Wed Jan 19 17:37:43 2011 +0100
@@ -115,7 +115,7 @@
return _qchar_lookup[c];
}
-static inline int _decode_hex_digit(char digit)
+static inline int _decode_hex_digit(unsigned char digit)
{
switch ( digit ) {
case '0': case '1': case '2': case '3': case '4':
@@ -134,20 +134,25 @@
static bool _parse_hex_value(const char **in, char *out)
{
- char value;
+ int value, digit;
- if ( **in == '\0' || (value=_decode_hex_digit(**in)) < 0 )
+ if ( (digit=_decode_hex_digit((unsigned char) **in)) < 0 )
return FALSE;
- *out = value << 4;
+ value = digit << 4;
(*in)++;
- if ( **in == '\0' || (value=_decode_hex_digit(**in)) < 0 )
+ if ( (digit=_decode_hex_digit((unsigned char) **in)) < 0 )
return FALSE;
- *out |= value;
+ value |= digit;
(*in)++;
- return (*out != '\0');
+
+ if ( value == 0 )
+ return FALSE;
+
+ *out = (char) value;
+ return TRUE;
}
/*
More information about the dovecot-cvs
mailing list