]> granicus.if.org Git - php/commitdiff
@ Fix bug in krsort() where an extra character was being compared (Andi)
authorAndi Gutmans <andi@php.net>
Sat, 29 Dec 2001 20:47:25 +0000 (20:47 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 29 Dec 2001 20:47:25 +0000 (20:47 +0000)
- Fix bug in krsort() where an extra character was being compared (Andi)

ext/standard/array.c

index 1b0ea251bac3447fd5cf091fe6afedf13ecf7614..653851b4c8f121aa1c1b51471258eb99ed40eb62 100644 (file)
@@ -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) {