diff options
author | erdgeist <> | 2007-10-23 00:39:21 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-23 00:39:21 +0000 |
commit | ab9246618b1d369cdba1140135dedb8affc5485e (patch) | |
tree | cf17f7cf4d164677597f1a4502f27ad8dfb48919 /scan_urlencoded_query.c | |
parent | 1fce733ea0037d67fd07d6738bed92da3ae7c81a (diff) |
some clients chose to accidently send negative numwants
Diffstat (limited to 'scan_urlencoded_query.c')
-rw-r--r-- | scan_urlencoded_query.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c index 241a904..a78a697 100644 --- a/scan_urlencoded_query.c +++ b/scan_urlencoded_query.c | |||
@@ -78,8 +78,11 @@ ssize_t scan_urlencoded_query(char **string, char *deststring, SCAN_SEARCHPATH_F | |||
78 | } | 78 | } |
79 | 79 | ||
80 | ssize_t scan_fixed_int( char *data, size_t len, int *tmp ) { | 80 | ssize_t scan_fixed_int( char *data, size_t len, int *tmp ) { |
81 | int minus = 0; | ||
81 | *tmp = 0; | 82 | *tmp = 0; |
83 | if( *data == '-' ) --len, ++data, ++minus; | ||
82 | while( (len > 0) && (*data >= '0') && (*data <= '9') ) { --len; *tmp = 10**tmp + *data++-'0'; } | 84 | while( (len > 0) && (*data >= '0') && (*data <= '9') ) { --len; *tmp = 10**tmp + *data++-'0'; } |
85 | if( minus ) *tmp = -*tmp; | ||
83 | return len; | 86 | return len; |
84 | } | 87 | } |
85 | 88 | ||