(svn r15171) -Fix (r15027): Buffer underflow in case there are no settings to save for an AI.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
Yexo 16 years ago
parent 38afe1fe3f
commit 61ee8ca42a

@ -208,5 +208,7 @@ void AIConfig::SettingsToString(char *string, int size)
strcat(string, no);
strcat(string, ",");
}
string[strlen(string) - 1] = '\0';
/* Remove the last ',', but only if at least one setting was saved. */
size_t len = strlen(string);
if (len > 0) string[len - 1] = '\0';
}

Loading…
Cancel
Save