This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Binary Data

Old posts that have not been replied to for several years.
Locked
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Binary Data

Post by BarkerJr »

For my mysql.mod, I want to be able to accept binary data. Users should be able to pass binary data to mysql_escape. However, it's passed to the module as a pointer. So, I effectively can't tell where the binary data argument ends (strlen() only reads to the first null, which is not the end of the argument).

Anyone know how I can determine the length of the data being passed to the function?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The only real method is to pass a second argument with the length of the data.

This pretty much goes along the lines of putdccraw. You can pass and use embeded NULLs in the data. For it to function correctly, the length is passed.
Locked