From: Speed D. <no...@so...> - 2012-04-03 14:23:18
|
#663: MSVC implementation of snprintf is not safe -------------------------------------+-------------------------------------- Reporter: pouillot | Owner: somebody Type: defect | Status: new Priority: major | Milestone: 2.1.0 Component: Whole game | Version: 2.0.0-dev Keywords: snprintf buffer overrun | -------------------------------------+-------------------------------------- Comment(by pouillot): A simple solution would be to write our own version of snprintf for the stupid MSVC compilers, like this : {{{ int snprintf_xxx(char *str, size_t size, const char *format, ...) { int len = snprintf(str, size, ...); // more complicated actually, but see trace.cpp ... str[size-1] = 0; return len; } }}} And to #define snprintf snprintf_xxx in portability.h -- Ticket URL: <http://sourceforge.net/apps/trac/speed-dreams/ticket/663#comment:1> Speed Dreams <http://sourceforge.net/projects/speed-dreams> An Open Motorsport Simulator featuring high-quality 3D graphics and an accurate physics engine, all targeting maximum realism as well as exciting new features, cars, tracks and AI opponents to make a more enjoyable game for the player. |