Igor Khavkine <i_khavki@alcor.concordia.ca> writes: > > strdup'ing perl strings is bad karma in general (they can contain > > NULs), although it's no problem in this case. > > That's why there is strndup(3). strndup("abc\0def", 99) will only malloc & copy 4 bytes. Only malloc + memcpy is appropriate for "strings" that may contain NUL. But that's largely OT by now. -- Robbe
Attachment:
signature.ng
Description: PGP signature