From eece353fe80cc9a20337c67d88be6924eb407823 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 31 Jan 2007 00:15:06 +0000 Subject: [PATCH] Minor code optimization --- ext/shmop/shmop.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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); } /* }}} */ -- 2.50.1