]> granicus.if.org Git - php/commitdiff
store the name length in the same manner as it is stored in zvals
authorWez Furlong <wez@php.net>
Fri, 21 May 2004 14:14:32 +0000 (14:14 +0000)
committerWez Furlong <wez@php.net>
Fri, 21 May 2004 14:14:32 +0000 (14:14 +0000)
ext/pdo/pdo_stmt.c

index 91a41b1ca466dcdfb4eac3cd33dff05dce9cea4e..970ec21901fd5906e91a50a4242297d871a77a15 100755 (executable)
@@ -242,7 +242,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
 
        if (param->name) {
                param->name = estrndup(param->name, param->namelen);
-               zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam);
+               zend_hash_update(hash, param->name, param->namelen+1, param, sizeof(*param), (void**)&pparam);
        } else {
                zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam);
        }
@@ -554,9 +554,6 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
                                        &param.parameter, &param.param_type, &param.max_value_len, &param.driver_params)) {
                        return 0;
                }       
-       } else {
-               /* since we're hashing this, we need the null byte too */
-               param.namelen = name_strlen + 1;
        }
 
        if (param.paramno > 0) {