From: Stanislav Malyshev Date: Sun, 4 Jun 2000 15:43:04 +0000 (+0000) Subject: \0 is part of they key, but not of the variable X-Git-Tag: PRE_EIGHT_BYTE_ALLOC_PATCH~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a23c64ee8bca80eb2efba882782295846f5cd3a8;p=php \0 is part of they key, but not of the variable --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 3d5de7021e..0056b78c37 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -614,7 +614,7 @@ static int array_user_key_compare(const void *a, const void *b) if (f->nKeyLength) { key1.value.str.val = estrndup(f->arKey, f->nKeyLength); - key1.value.str.len = f->nKeyLength; + key1.value.str.len = f->nKeyLength-1; key1.type = IS_STRING; } else { key1.value.lval = f->h; @@ -622,7 +622,7 @@ static int array_user_key_compare(const void *a, const void *b) } if (s->nKeyLength) { key2.value.str.val = estrndup(s->arKey, s->nKeyLength); - key2.value.str.len = s->nKeyLength; + key2.value.str.len = s->nKeyLength-1; key2.type = IS_STRING; } else { key2.value.lval = s->h;