Changeset - r21405:f2833213c8e9
[Not reviewed]
master
0 2 0
frosch - 10 years ago 2014-04-24 18:58:47
frosch@openttd.org
(svn r26504) -Fix (r26499): Obiwan and his gang.
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/game/game_text.cpp
Show inline comments
 
@@ -66,7 +66,7 @@ void NORETURN CDECL strgen_fatal(const c
 
 */
 
LanguageStrings::LanguageStrings(const char *language, const char *end)
 
{
 
	this->language = stredup(language, end - 1);
 
	this->language = stredup(language, end != NULL ? end - 1 : NULL);
 
}
 

	
 
/** Free everything. */
src/ini_load.cpp
Show inline comments
 
@@ -167,7 +167,7 @@ IniGroup *IniLoadFile::GetGroup(const ch
 
	if (!create_new) return NULL;
 

	
 
	/* otherwise make a new one */
 
	IniGroup *group = new IniGroup(this, name, name + len);
 
	IniGroup *group = new IniGroup(this, name, name + len - 1);
 
	group->comment = strdup("\n");
 
	return group;
 
}
 
@@ -264,7 +264,7 @@ void IniLoadFile::LoadFromDisk(const cha
 
			s++; // skip [
 
			group = new IniGroup(this, s, e - 1);
 
			if (comment_size != 0) {
 
				group->comment = stredup(comment, comment + comment_size);
 
				group->comment = stredup(comment, comment + comment_size - 1);
 
				comment_size = 0;
 
			}
 
		} else if (group != NULL) {
 
@@ -272,7 +272,7 @@ void IniLoadFile::LoadFromDisk(const cha
 
				/* A sequence group, use the line as item name without further interpretation. */
 
				IniItem *item = new IniItem(group, buffer, e - 1);
 
				if (comment_size) {
 
					item->comment = stredup(comment, comment + comment_size);
 
					item->comment = stredup(comment, comment + comment_size - 1);
 
					comment_size = 0;
 
				}
 
				continue;
 
@@ -290,7 +290,7 @@ void IniLoadFile::LoadFromDisk(const cha
 
			/* it's an item in an existing group */
 
			IniItem *item = new IniItem(group, s, t - 1);
 
			if (comment_size != 0) {
 
				item->comment = stredup(comment, comment + comment_size);
 
				item->comment = stredup(comment, comment + comment_size - 1);
 
				comment_size = 0;
 
			}
 

	
 
@@ -306,7 +306,7 @@ void IniLoadFile::LoadFromDisk(const cha
 
			*e = '\0';
 

	
 
			/* If the value was not quoted and empty, it must be NULL */
 
			item->value = (!quoted && e == t) ? NULL : stredup(t, e);
 
			item->value = (!quoted && e == t) ? NULL : stredup(t);
 
			if (item->value != NULL) str_validate(item->value, item->value + strlen(item->value));
 
		} else {
 
			/* it's an orphan item */
 
@@ -315,7 +315,7 @@ void IniLoadFile::LoadFromDisk(const cha
 
	}
 

	
 
	if (comment_size > 0) {
 
		this->comment = stredup(comment, comment + comment_size);
 
		this->comment = stredup(comment, comment + comment_size - 1);
 
		comment_size = 0;
 
	}
 

	
0 comments (0 inline, 0 general)