From: Jouni Ahto Date: Thu, 1 Jun 2000 13:38:23 +0000 (+0000) Subject: (ucwords) Fixed fix for fix for fix for #4748. X-Git-Tag: PRE_EIGHT_BYTE_ALLOC_PATCH~157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30c5b53ad1083505c4694a9135ca444a9c5151ff;p=php (ucwords) Fixed fix for fix for fix for #4748. # Today's most fixed bug. --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 62c95f1689..77b0a3949b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1153,9 +1153,11 @@ PHP_FUNCTION(ucwords) r=return_value->value.str.val; *r=toupper((unsigned char)*r); - for(r_end = r + return_value->value.str.len -1 ; r < r_end ; r++ ) { + for(r_end = r + return_value->value.str.len -1 ; r < r_end ; ) { if(isspace(*r)) { - *++r=toupper((unsigned char)*r); + *r=toupper((unsigned char)*++r); + } else { + r++; } } }