Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since the string from strerror should never be modified, use const. #202

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions source/glest_game/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
int result = rename(duplicateFile.c_str(),expandedNewCommonFileName.c_str());
if(result != 0) {
char szBuf[8096]="";
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"!!! Error [%s] Could not rename [%s] to [%s]!",errmsg,duplicateFile.c_str(),expandedNewCommonFileName.c_str());
throw megaglest_runtime_error(szBuf);
}
Expand Down Expand Up @@ -2466,7 +2466,7 @@ void runTechValidationForPath(string techPath, string techName,
int result = rename(duplicateFile.c_str(),expandedNewCommonFileName.c_str());
if(result != 0) {
char szBuf[8096]="";
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"!!! Error [%s] Could not rename [%s] to [%s]!",errmsg,duplicateFile.c_str(),expandedNewCommonFileName.c_str());
throw megaglest_runtime_error(szBuf);
}
Expand Down Expand Up @@ -3401,7 +3401,7 @@ void CheckForDuplicateData() {
char szBuf[8096]="";
int result = rename(oldFile.c_str(),newFile.c_str());
if(result != 0) {
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"Error [%s]\nCould not rename [%s] to [%s]!",errmsg,oldFile.c_str(),newFile.c_str());
throw megaglest_runtime_error(szBuf,true);
}
Expand Down Expand Up @@ -3452,7 +3452,7 @@ void CheckForDuplicateData() {
char szBuf[8096]="";
int result = rename(oldFile.c_str(),newFile.c_str());
if(result != 0) {
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"Error [%s]\nCould not rename [%s] to [%s]!",errmsg,oldFile.c_str(),newFile.c_str());
throw megaglest_runtime_error(szBuf,true);
}
Expand All @@ -3466,7 +3466,7 @@ void CheckForDuplicateData() {
result = rename(oldFile.c_str(),newFile.c_str());

if(result != 0) {
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"Error [%s]\nCould not rename [%s] to [%s]!",errmsg,oldFile.c_str(),newFile.c_str());
throw megaglest_runtime_error(szBuf,true);
}
Expand Down Expand Up @@ -3514,7 +3514,7 @@ void CheckForDuplicateData() {
char szBuf[8096]="";
int result = rename(oldFile.c_str(),newFile.c_str());
if(result != 0) {
char *errmsg = strerror(errno);
const char *errmsg = strerror(errno);
snprintf(szBuf,8096,"Error [%s]\nCould not rename [%s] to [%s]!",errmsg,oldFile.c_str(),newFile.c_str());
throw megaglest_runtime_error(szBuf,true);
}
Expand Down