]> git.kaiwu.me - nginx.git/commitdiff
Geo: improved ngx_http_geo_block() code readability.
authorRuslan Ermilov <ru@nginx.com>
Fri, 14 Dec 2012 19:35:37 +0000 (19:35 +0000)
committerRuslan Ermilov <ru@nginx.com>
Fri, 14 Dec 2012 19:35:37 +0000 (19:35 +0000)
src/http/modules/ngx_http_geo_module.c

index bdad969a1b85dcf35401c7adb3239d77bd7bed07..8d2679db58d4bb32185f0318a4682c66ccc8c483 100644 (file)
@@ -303,7 +303,6 @@ static char *
 ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char                     *rv;
-    void                    **p;
     size_t                    len;
     ngx_str_t                *value, name;
     ngx_uint_t                i;
@@ -402,8 +401,8 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
                     return NGX_CONF_ERROR;
                 }
 
-                p = (void **) ngx_cpymem(ctx.high.low[i], a->elts, len);
-                *p = NULL;
+                ngx_memcpy(ctx.high.low[i], a->elts, len);
+                ctx.high.low[i][a->nelts].value = NULL;
                 ctx.data_size += len + sizeof(void *);
             }