serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1710803 - /serf/trunk/protocols/http2_protocol.c
Date Tue, 27 Oct 2015 12:53:39 GMT
Author: rhuijben
Date: Tue Oct 27 12:53:39 2015
New Revision: 1710803

URL: http://svn.apache.org/viewvc?rev=1710803&view=rev
Log:
* protocols/http2_protocol.c
  (serf_bucket_create_numberv): Rename varargs variable and properly call
    va_end as required by the docs.

Modified:
    serf/trunk/protocols/http2_protocol.c

Modified: serf/trunk/protocols/http2_protocol.c
URL: http://svn.apache.org/viewvc/serf/trunk/protocols/http2_protocol.c?rev=1710803&r1=1710802&r2=1710803&view=diff
==============================================================================
--- serf/trunk/protocols/http2_protocol.c (original)
+++ serf/trunk/protocols/http2_protocol.c Tue Oct 27 12:53:39 2015
@@ -46,13 +46,13 @@ http2_protocol_teardown(serf_connection_
 static serf_bucket_t *
 serf_bucket_create_numberv(serf_bucket_alloc_t *allocator, const char *format, ...)
 {
-  va_list va;
+  va_list argp;
   const char *c;
   char *buffer;
   apr_size_t sz = 0;
   unsigned char *r;
 
-  va_start(va, format);
+  va_start(argp, format);
 
   for (c = format; *c; c++)
     {
@@ -88,28 +88,28 @@ serf_bucket_create_numberv(serf_bucket_a
        switch (*c)
         {
           case '1':
-            *r++ = va_arg(va, char);
+            *r++ = va_arg(argp, char);
             break;
           case '2':
-            tmp = va_arg(va, apr_uint16_t);
+            tmp = va_arg(argp, apr_uint16_t);
             *r++ = (tmp >> 8) & 0xFF;
             *r++ = tmp & 0xFF;
             break;
           case '3':
-            tmp = va_arg(va, apr_uint32_t);
+            tmp = va_arg(argp, apr_uint32_t);
             *r++ = (tmp >> 16) & 0xFF;
             *r++ = (tmp >> 8) & 0xFF;
             *r++ = tmp & 0xFF;
             break;
           case '4':
-            tmp = va_arg(va, apr_uint32_t);
+            tmp = va_arg(argp, apr_uint32_t);
             *r++ = (tmp >> 24) & 0xFF;
             *r++ = (tmp >> 16) & 0xFF;
             *r++ = (tmp >> 8) & 0xFF;
             *r++ = tmp & 0xFF;
             break;
           case '8':
-            tmp_64 = va_arg(va, apr_uint64_t);
+            tmp_64 = va_arg(argp, apr_uint64_t);
             *r++ = (tmp_64 >> 56) & 0xFF;
             *r++ = (tmp_64 >> 48) & 0xFF;
             *r++ = (tmp_64 >> 40) & 0xFF;
@@ -121,6 +121,9 @@ serf_bucket_create_numberv(serf_bucket_a
             break;
        }
     }
+
+  va_end(argp);
+
   return serf_bucket_simple_own_create(buffer, sz, allocator);
 }
 



Mime
View raw message