lenght of char buffers in PyArg_ParseTuple

Patrick Stinson ajole-1 at gci.net
Thu Jun 10 04:42:20 EDT 2004


is there any way to figure out how long the string buffer of a passed string
object was after PyArg_ParseTuple(args, "s", &mybuffer)?

I'm potentially copying data from a call to socket.inet_pton(), which is a
string type but strlen(mybuffer) should not work in the case of a
NUL-terminator before the end of the buffer.

Cheers



More information about the Python-list mailing list