From: Ilia Alshanetsky Date: Wed, 31 Jan 2007 00:15:06 +0000 (+0000) Subject: Minor code optimization X-Git-Tag: RELEASE_1_0_0RC1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eece353fe80cc9a20337c67d88be6924eb407823;p=php Minor code optimization --- diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 5ee2ca266f..ebd5082c8d 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -244,11 +244,7 @@ PHP_FUNCTION(shmop_read) startaddr = shmop->addr + start; bytes = count ? count : shmop->size - start; - return_string = emalloc(bytes+1); - memcpy(return_string, startaddr, bytes); - return_string[bytes] = 0; - - RETURN_STRINGL(return_string, bytes, 0); + RETURN_STRINGL(startaddr, bytes, 1); } /* }}} */