Lines 27-33
Link Here
|
27 |
static const char *getDirectoryPath(const char *file) |
27 |
static const char *getDirectoryPath(const char *file) |
28 |
{ |
28 |
{ |
29 |
static char buffer[256]; |
29 |
static char buffer[256]; |
30 |
sprintf(buffer, PKGDIR "%s", file); |
30 |
snprintf(buffer, sizeof(buffer), "%s%s", PKGDIR, file); |
31 |
return buffer; |
31 |
return buffer; |
32 |
} |
32 |
} |
33 |
|
33 |
|
Lines 80-90
bool ModelID::initFromNode(const char *d
Link Here
|
80 |
|
80 |
|
81 |
const char *skinNameContent = skinNode->getContent(); |
81 |
const char *skinNameContent = skinNode->getContent(); |
82 |
static char skinName[1024]; |
82 |
static char skinName[1024]; |
83 |
sprintf(skinName, "%s/%s", directory, skinNameContent); |
83 |
snprintf(skinName, sizeof(skinName), "%s/%s", directory, skinNameContent); |
84 |
|
84 |
|
85 |
const char *meshNameContent = meshNode->getContent(); |
85 |
const char *meshNameContent = meshNode->getContent(); |
86 |
static char meshName[1024]; |
86 |
static char meshName[1024]; |
87 |
sprintf(meshName, "%s/%s", directory, meshNameContent); |
87 |
snprintf(meshName, sizeof(meshName), "%s/%s", directory, meshNameContent); |
88 |
|
88 |
|
89 |
if (!::wxFileExists(getDirectoryPath(skinName))) |
89 |
if (!::wxFileExists(getDirectoryPath(skinName))) |
90 |
{ |
90 |
{ |
Lines 108-114
bool ModelID::initFromNode(const char *d
Link Here
|
108 |
{ |
108 |
{ |
109 |
const char *meshNameContent = modelNode->getContent(); |
109 |
const char *meshNameContent = modelNode->getContent(); |
110 |
static char meshName[1024]; |
110 |
static char meshName[1024]; |
111 |
sprintf(meshName, "%s/%s", directory, meshNameContent); |
111 |
snprintf(meshName, sizeof(meshName),"%s/%s", directory, meshNameContent); |
112 |
|
112 |
|
113 |
if (!::wxFileExists(getDirectoryPath(meshName))) |
113 |
if (!::wxFileExists(getDirectoryPath(meshName))) |
114 |
{ |
114 |
{ |