diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2002-01-17 19:58:53 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2002-01-17 19:58:53 +0000 |
| commit | 5b20d4c06774dbb622a814c83a665430759ea2d3 (patch) | |
| tree | 0cc74fe0ba36fe0a9922bf9f792a61d41c7aafb9 /ext | |
| parent | 53f8b2d28b2d38da4eb6e08069c13fa85aa7a0ed (diff) | |
| download | php-git-5b20d4c06774dbb622a814c83a665430759ea2d3.tar.gz | |
Fixed shmop_read to append \0 to returned string in shmop_read to eliminate Zend warnings
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/shmop/shmop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 0c8c0c2cc5..7e4fa3df0e 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -242,8 +242,9 @@ PHP_FUNCTION(shmop_read) startaddr = shmop->addr + (*start)->value.lval; bytes = (*count)->value.lval ? (*count)->value.lval : shmop->size-(*start)->value.lval; - return_string = emalloc(bytes); + return_string = emalloc(bytes+1); memcpy(return_string, startaddr, bytes); + return_string[bytes] = 0; RETURN_STRINGL(return_string, bytes, 0); } |
