You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by pg...@apache.org on 2010/08/04 23:15:04 UTC
svn commit: r982408 - /apr/apr/trunk/memcache/apr_memcache.c
Author: pgollucci
Date: Wed Aug 4 21:15:02 2010
New Revision: 982408
URL: http://svn.apache.org/viewvc?rev=982408&view=rev
Log:
- Fix mismatched signed comparisons [1]
- While here replace atoi with strtol(3)
Reported by: sf via gcc
Modified:
apr/apr/trunk/memcache/apr_memcache.c
Modified: apr/apr/trunk/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memcache/apr_memcache.c?rev=982408&r1=982407&r2=982408&view=diff
==============================================================================
--- apr/apr/trunk/memcache/apr_memcache.c (original)
+++ apr/apr/trunk/memcache/apr_memcache.c Wed Aug 4 21:15:02 2010
@@ -787,10 +787,10 @@ apr_memcache_getp(apr_memcache_t *mc,
length = apr_strtok(NULL, " ", &last);
if (length) {
- len = atoi(length);
+ len = strtol(length, (char **)NULL, 10);
}
- if (len < 0) {
+ if (len != 0 ) {
*new_length = 0;
*baton = NULL;
}
@@ -1358,14 +1358,14 @@ apr_memcache_multgetp(apr_memcache_t *mc
length = apr_strtok(NULL, " ", &last);
if (length) {
- len = atoi(length);
+ len = strtol(length, (char **) NULL, 10);
}
value = apr_hash_get(values, key, strlen(key));
if (value) {
- if (len >= 0) {
+ if (len != 0) {
apr_bucket_brigade *bbb;
apr_bucket *e;