apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1390512 - in /apr/apr-util/branches/1.4.x: ./ include/apr_buckets.h memcache/apr_memcache.c
Date Wed, 26 Sep 2012 14:25:38 GMT
Author: trawick
Date: Wed Sep 26 14:25:37 2012
New Revision: 1390512

URL: http://svn.apache.org/viewvc?rev=1390512&view=rev
Log:
merge these fixes from trunk:

r982408:
- Fix mismatched signed comparisons [1]
- While here replace atoi with strtol(3)

Reported by:	sf via gcc [1]

r982409:
- this is handling the error condition, not success
  [note, testmemcache apparently doesn't hit this path]

Modified:
    apr/apr-util/branches/1.4.x/   (props changed)
    apr/apr-util/branches/1.4.x/include/apr_buckets.h   (props changed)
    apr/apr-util/branches/1.4.x/memcache/apr_memcache.c

Propchange: apr/apr-util/branches/1.4.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r982408-982409

Propchange: apr/apr-util/branches/1.4.x/include/apr_buckets.h
------------------------------------------------------------------------------
  Merged /apr/apr/trunk/include/apr_buckets.h:r982408-982409

Modified: apr/apr-util/branches/1.4.x/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/memcache/apr_memcache.c?rev=1390512&r1=1390511&r2=1390512&view=diff
==============================================================================
--- apr/apr-util/branches/1.4.x/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/1.4.x/memcache/apr_memcache.c Wed Sep 26 14:25:37 2012
@@ -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;
         }
@@ -1356,14 +1356,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;
                        



Mime
View raw message