🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Plz help verify wsvprintf bug
This is a wild guess but wouldn't the '\n' character also show up as an character in strlen. Because to my knowledge strlen only stops counting at the '\0' null-terminating character, but returns the stringlength with special characters included.
Hi,
for the variable argument formatting function in windows, wsvprintf, the docs says that if an error occurs, the functions returns a value lesser than the length of the format-control string.
But if the formatting string is as such
wsvprintf(buffer,"%d\n",va_list);
and the value is a single digit, say 8, the return value is 2 although strlen of the control string is 3. So either this is a bug or strlen shouldn't be used. Someone plz explain.
Thanks.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement