summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-30 10:49:02 +0000
committeryexo <yexo@openttd.org>2010-08-30 10:49:02 +0000
commite91e2498c7ec37ffbbe948cd29bb15eedec85957 (patch)
treef889ca0d81c7f92bc609efa26c418a94f281a5ef
parent9a05f8004bf2848db365f9a5c1bbfe9ef7c8dc36 (diff)
downloadopenttd-e91e2498c7ec37ffbbe948cd29bb15eedec85957.tar.xz
(svn r20693) -Fix: use strncmp instead of memcmp for comparing strings
-rw-r--r--src/ini.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ini.cpp b/src/ini.cpp
index f249f7b93..d79189bd2 100644
--- a/src/ini.cpp
+++ b/src/ini.cpp
@@ -114,7 +114,7 @@ IniGroup *IniFile::GetGroup(const char *name, size_t len)
/* does it exist already? */
for (IniGroup *group = this->group; group != NULL; group = group->next) {
- if (!memcmp(group->name, name, len) && group->name[len] == 0) {
+ if (!strncmp(group->name, name, len) && group->name[len] == 0) {
return group;
}
}
@@ -133,7 +133,7 @@ void IniFile::RemoveGroup(const char *name)
/* does it exist already? */
for (group = this->group; group != NULL; prev = group, group = group->next) {
- if (memcmp(group->name, name, len) == 0) {
+ if (strncmp(group->name, name, len) == 0) {
break;
}
}