Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > lenght of char buffers in PyArg_ParseTuple

Reply
Thread Tools

lenght of char buffers in PyArg_ParseTuple

 
 
Patrick Stinson
Guest
Posts: n/a
 
      06-10-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
 
Reply With Quote
 
 
 
 
Duncan Booth
Guest
Posts: n/a
 
      06-10-2004
Patrick Stinson <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

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


No, but there is if you call PyArg_ParseTuple(args, "s#", &mybuffer,
&length) instead.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not consistent lovecreatesbeauty C Programming 1 05-09-2006 08:01 AM
/usr/bin/ld: ../../dist/lib/libjsdombase_s.a(BlockGrouper.o)(.text+0x98): unresolvable relocation against symbol `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostre silverburgh.meryl@gmail.com C++ 3 03-09-2006 12:14 AM
STL: Do people still use char[] buffers? syncman C++ 4 01-20-2004 09:09 PM
The difference between char a[6] and char *p=new char[6] ? wwj C Programming 24 11-07-2003 05:27 PM
the difference between char a[6] and char *p=new char[6] . wwj C++ 7 11-05-2003 12:59 AM



Advertisments