fix(Core/Tools): fix GCC warnings in extractors (#3430)
This commit is contained in:
@@ -99,8 +99,12 @@ void CreateDir( const std::string& Path )
|
|||||||
{
|
{
|
||||||
if(chdir(Path.c_str()) == 0)
|
if(chdir(Path.c_str()) == 0)
|
||||||
{
|
{
|
||||||
chdir("../");
|
int ret = chdir("../");
|
||||||
return;
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("Error while executing chdir");
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -185,10 +185,15 @@ bool ExtractSingleWmo(std::string& fname)
|
|||||||
for (uint32 i = 0; i < froot.nGroups; ++i)
|
for (uint32 i = 0; i < froot.nGroups; ++i)
|
||||||
{
|
{
|
||||||
char temp[1024];
|
char temp[1024];
|
||||||
strcpy(temp, fname.c_str());
|
strncpy(temp, fname.c_str(), 1024);
|
||||||
temp[fname.length()-4] = 0;
|
temp[fname.length()-4] = 0;
|
||||||
char groupFileName[1024];
|
char groupFileName[1024];
|
||||||
sprintf(groupFileName, "%s_%03u.wmo", temp, i);
|
int ret = snprintf(groupFileName, 1024, "%s_%03u.wmo", temp, i);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("Error when formatting string");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//printf("Trying to open groupfile %s\n",groupFileName);
|
//printf("Trying to open groupfile %s\n",groupFileName);
|
||||||
|
|
||||||
string s = groupFileName;
|
string s = groupFileName;
|
||||||
@@ -340,7 +345,12 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames)
|
|||||||
|
|
||||||
// now, scan for the patch levels in the core dir
|
// now, scan for the patch levels in the core dir
|
||||||
printf("Scanning patch levels from data directory.\n");
|
printf("Scanning patch levels from data directory.\n");
|
||||||
sprintf(path, "%spatch", input_path);
|
int ret = snprintf(path, 512, "%spatch", input_path);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("Error when formatting string");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!scan_patches(path, pArchiveNames))
|
if (!scan_patches(path, pArchiveNames))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
@@ -350,7 +360,12 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames)
|
|||||||
for (std::vector<std::string>::iterator i = locales.begin(); i != locales.end(); ++i)
|
for (std::vector<std::string>::iterator i = locales.begin(); i != locales.end(); ++i)
|
||||||
{
|
{
|
||||||
printf("Locale: %s\n", i->c_str());
|
printf("Locale: %s\n", i->c_str());
|
||||||
sprintf(path, "%s%s/patch-%s", input_path, i->c_str(), i->c_str());
|
int ret2 = snprintf(path, 512, "%s%s/patch-%s", input_path, i->c_str(), i->c_str());
|
||||||
|
if (ret2 < 0)
|
||||||
|
{
|
||||||
|
printf("Error when formatting string");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(scan_patches(path, pArchiveNames))
|
if(scan_patches(path, pArchiveNames))
|
||||||
foundOne = true;
|
foundOne = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user