The code should be (*len)--; then the result is as desired, I'll adjust.
On 19-May-09, at 1:33 PM, Matteo Beccati wrote:
Ilia Alshanetsky ha scritto:
*len is a pointer to an integer, that is being decremented to
overall length of the string to "remove" the NUL terminator. If you
remove the operation you'll end up with 2 NULs at the end of the
As I said, I coulndn't find any reference to the fact that "the NUL
terminator is included in the byte count for TEXT values" in
I don't want to argue about this, but here's a small test case that
hopefully proves that the code you added back is just useless, as it
doesn't do what you'd expect by reading the comment.
$ cat len.c; gcc -Wall len.c; ./a.out
void decrease_len(int *len)
int main(int argc, char **argv)
int len = 10;
assert(len == 9);
len.c: In function ‘decrease_len’:
len.c:6: warning: value computed is not used
a.out: len.c:14: main: Assertion `len == 9' failed.
OpenX - http://www.openx.org
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php