On Saturday 18 December 2004 04:12 pm, Sasha Pachev wrote: > > Darrell: > > Note that MySQL is attempting to parse something that you do not seem to > have in your query. I believe what is happening is that you are overwriting > some buffer somewhere (possibly in the sprintf() call), and then end up > sending garbage to mysql_query(). Instead of using sprintf(), I would > recommend either a manual construction of the string with calls to > mysql_real_escape_string(), or something like myvsprintf(), which you can > find at > > http://mysql.he.net/Downloads/Contrib/mysnprintf.c > > or any other MySQL mirror. > > The problem with sprintf() is that it does not check buffer boundaries, and > does not escape the strings. snprintf() will check the boundaries, but you > would have to do the escaping yourself. mysnprintf() will do both for you. > > If sprintf() fix/check does not help, get valgrind from > http://valgrind.kde.org/ ( or use your favorite memory error detection > tool), and see what it says. Thanks, that truly was the problem. I found that another sprintf() statement was overwriting the first. I will try some of the alternatives you have listed.
-- Darrell Cormier Registered Linux user #370711 http://counter.li.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]