summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-13 08:18:30 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-13 08:18:30 +0000
commitb5a45d73ab2df78b85b03e7cf252dd12b0634f05 (patch)
treefd5a784ef3d8ac735c5da7c5c229f7c8d7c4d026
parent0d4539c174f5497dc23cbdfa8b28a4053f32a7ca (diff)
downloadhercules-b5a45d73ab2df78b85b03e7cf252dd12b0634f05.tar.gz
hercules-b5a45d73ab2df78b85b03e7cf252dd12b0634f05.tar.bz2
hercules-b5a45d73ab2df78b85b03e7cf252dd12b0634f05.tar.xz
hercules-b5a45d73ab2df78b85b03e7cf252dd12b0634f05.zip
Corrected a potentially uninitialized variable in sv_parse (bugreport:2860).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13581 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/common/strlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 648a06d18..9b97aabba 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -872,6 +872,8 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc
int columns;
char path[1024], line[1024];
+ snprintf(path, sizeof(path), "%s/%s", directory, filename);
+
if( maxcols > ARRAYLENGTH(fields)-1 )
{
ShowError("sv_readdb: Insufficient column storage in parser for file \"%s\" (want %d, have only %d). Increase the capacity in the source code please.\n", path, maxcols, ARRAYLENGTH(fields)-1);
@@ -879,7 +881,6 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc
}
// open file
- snprintf(path, sizeof(path), "%s/%s", directory, filename);
fp = fopen(path, "r");
if( fp == NULL )
{