summaryrefslogtreecommitdiff
path: root/scan_urlencoded_query.c
diff options
context:
space:
mode:
authorerdgeist <>2007-01-31 09:50:46 +0000
committererdgeist <>2007-01-31 09:50:46 +0000
commit6e1ee92de6ff1f9b29453c8ae1d2d831db6a3e1a (patch)
tree436324cb02e2c08b1bb4c176462823a81d239dd6 /scan_urlencoded_query.c
parent11abb03e85d6580699c4760e0267a972f78e6c03 (diff)
Use signed size_t wherever appropriate
Diffstat (limited to 'scan_urlencoded_query.c')
-rw-r--r--scan_urlencoded_query.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c
index dc43b61..d89e610 100644
--- a/scan_urlencoded_query.c
+++ b/scan_urlencoded_query.c
@@ -21,7 +21,7 @@ static int is_unreserved( unsigned char c ) {
21 if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); 21 if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7));
22} 22}
23 23
24size_t scan_urlencoded_query(char **string, char *deststring, int flags) { 24ssize_t scan_urlencoded_query(char **string, char *deststring, int flags) {
25 register const unsigned char* s=*(const unsigned char**) string; 25 register const unsigned char* s=*(const unsigned char**) string;
26 unsigned char *d = (unsigned char*)deststring; 26 unsigned char *d = (unsigned char*)deststring;
27 register unsigned char b, c; 27 register unsigned char b, c;
@@ -62,18 +62,17 @@ found_terminator:
62 return d - (unsigned char*)deststring; 62 return d - (unsigned char*)deststring;
63} 63}
64 64
65size_t scan_fixed_int( char *data, size_t len, int *tmp ) { 65ssize_t scan_fixed_int( char *data, size_t len, int *tmp ) {
66 *tmp = 0; 66 *tmp = 0;
67 while( (len > 0) && (*data >= '0') && (*data <= '9') ) { --len; *tmp = 10**tmp + *data++-'0'; } 67 while( (len > 0) && (*data >= '0') && (*data <= '9') ) { --len; *tmp = 10**tmp + *data++-'0'; }
68 return len; 68 return len;
69} 69}
70 70
71size_t scan_fixed_ip( char *data, size_t len, unsigned char ip[4] ) { 71ssize_t scan_fixed_ip( char *data, size_t len, unsigned char ip[4] ) {
72 int u, i; 72 int u, i;
73 73
74 for( i=0; i<4; ++i ) { 74 for( i=0; i<4; ++i ) {
75 register unsigned int j; 75 ssize_t j = scan_fixed_int( data, len, &u );
76 j = scan_fixed_int( data, len, &u );
77 if( j == len ) return len; 76 if( j == len ) return len;
78 ip[i] = u; 77 ip[i] = u;
79 data += len - j; 78 data += len - j;