Re: shmop errors

From: Date: Thu, 17 Jan 2002 10:11:08 +0000
Subject: Re: shmop errors
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-77327@lists.php.net to get a copy of this message
Hello, I think this is the only possible way to do it... (without rewriting the whole extension). Derick On 17 Jan 2002, Robin Ericsson wrote: > Using this fix, it works for me, but I don't know if this is the right > way to go.. > > diff -u -u -r1.21 shmop.c > --- shmop.c 9 Jan 2002 08:02:21 -0000 1.21 > +++ shmop.c 17 Jan 2002 10:11:02 -0000 > @@ -242,8 +242,9 @@ > 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); > } > > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#77327) next »