From: Andi Gutmans Date: Sat, 29 Dec 2001 20:47:25 +0000 (+0000) Subject: @ Fix bug in krsort() where an extra character was being compared (Andi) X-Git-Tag: PRE_ISSET_PATCH~371 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=211d712c5910dc8a21e364d53323d9aad0aa3d7e;p=php @ Fix bug in krsort() where an extra character was being compared (Andi) - Fix bug in krsort() where an extra character was being compared (Andi) --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 1b0ea251ba..653851b4c8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -137,7 +137,7 @@ static int array_key_compare(const void *a, const void *b TSRMLS_DC) } else { Z_TYPE(first) = IS_STRING; Z_STRVAL(first) = f->arKey; - Z_STRLEN(first) = f->nKeyLength; + Z_STRLEN(first) = f->nKeyLength-1; } if (s->nKeyLength == 0) { @@ -146,7 +146,7 @@ static int array_key_compare(const void *a, const void *b TSRMLS_DC) } else { Z_TYPE(second) = IS_STRING; Z_STRVAL(second) = s->arKey; - Z_STRLEN(second) = s->nKeyLength; + Z_STRLEN(second) = s->nKeyLength-1; } if (ARRAYG(compare_func)(&result, &first, &second TSRMLS_CC) == FAILURE) {