1
0
Fork 0

Add patch 1239754 from Moe. This patches fixes a few crashes by checking the SDL_SetMode return value and it changes strncopy to a safe_strncopy which adds a 0 to each string copied

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2240
This commit is contained in:
Peter Veenstra 2005-07-19 19:45:33 +00:00
parent 3429a18dc4
commit c7c2ee5d5a
14 changed files with 56 additions and 41 deletions

View file

@ -34,6 +34,8 @@
//#define nocasestrcmp(a,b) stricmp(a,b)
#endif
#define safe_strncpy(a,b,n) do { strncpy((a),(b),(n)-1); (a)[(n)-1] = 0; } while (0)
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif