Changeset - r15995:16072085754a
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-08-30 10:49:02
yexo@openttd.org
(svn r20693) -Fix: use strncmp instead of memcmp for comparing strings
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/ini.cpp
Show inline comments
 
@@ -114,7 +114,7 @@ IniGroup *IniFile::GetGroup(const char *
 

	
 
	/* 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 *na
 

	
 
	/* 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;
 
		}
 
	}
0 comments (0 inline, 0 general)