EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   SprintF (https://www.eqemulator.org/forums/showthread.php?t=34524)

provocating 11-27-2011 04:36 PM

SprintF
 
When did this start crapping out ? I am in my second day of C++ mental bombardment and reading old post I though this would work. Not exactly what I was trying to do, but right now just narrowing down my error.

Code:

sprintf("%c",0x12);
Code:

questmgr.cpp:1108: error: invalid conversion from âintâ to âconst char*â
questmgr.cpp:1108: error:  initializing argument 2 of âint sprintf(char*, const char*, ...)â


provocating 11-27-2011 05:20 PM

Nevermind, obviously I needed to RTFM.

daerath 12-04-2011 02:36 PM

Quote:

Originally Posted by provocating (Post 204904)
Nevermind, obviously I needed to RTFM.

At no point should you be using sprintf.

http://msdn.microsoft.com/en-us/library/bb288454.aspx

sprintf (and a host of other function calls) are at the root of essentially every buffer overflow.

banned.h and strsafe.h are your friends.

provocating 12-04-2011 02:41 PM

Well I got it from questmgr.cpp

I just did a quick ctr-f and found a ton of them in there, /shrug.

In the end it did not matter, the code I added did not need it anyway.


All times are GMT -4. The time now is 11:03 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.