You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2012/09/26 16:22:50 UTC

svn commit: r1390509 - in /apr/apr-util/branches/1.5.x: ./ memcache/apr_memcache.c

Author: trawick
Date: Wed Sep 26 14:22:49 2012
New Revision: 1390509

URL: http://svn.apache.org/viewvc?rev=1390509&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.5.x/   (props changed)
    apr/apr-util/branches/1.5.x/memcache/apr_memcache.c

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

Modified: apr/apr-util/branches/1.5.x/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/memcache/apr_memcache.c?rev=1390509&r1=1390508&r2=1390509&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/memcache/apr_memcache.c (original)
+++ apr/apr-util/branches/1.5.x/memcache/apr_memcache.c Wed Sep 26 14:22:49 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;