sprintf and strings with NULL byte
| From: | Andrei Zmievski | Date: | Wed, 25 Apr 2001 20:19:47 +0000 |
| Subject: | sprintf and strings with NULL byte | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52430@lists.php.net to get a copy of this message | ||
Do we have any facilities (in C) for sprintf'ing the strings that may
have NULL byte inside? For example, if name is "foo\0bar", and name_len
is 7,
sprintf(buf, "name: %*s", name_len, name);
Does not give the correct result - stops at the first null byte.
-Andrei
"The secret of flying is to throw yourself
at the ground, and miss." -- Douglas Adams