Changeset - r21412:c6fb8f61577c
[Not reviewed]
master
0 4 0
rubidium - 11 years ago 2014-04-25 17:43:09
rubidium@openttd.org
(svn r26511) -Codechange: use strecpy in game_text
4 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/game/game_text.cpp
Show inline comments
 
@@ -151,11 +151,11 @@ struct StringListReader : StringReader {
 
	{
 
	}
 

	
 
	/* virtual */ char *ReadLine(char *buffer, size_t size)
 
	/* virtual */ char *ReadLine(char *buffer, const char *last)
 
	{
 
		if (this->p == this->end) return NULL;
 

	
 
		strncpy(buffer, *this->p, size);
 
		strecpy(buffer, *this->p, last);
 
		this->p++;
 

	
 
		return buffer;
src/strgen/strgen.cpp
Show inline comments
 
@@ -122,9 +122,9 @@ struct FileStringReader : StringReader {
 
		fclose(this->fh);
 
	}
 

	
 
	/* virtual */ char *ReadLine(char *buffer, size_t size)
 
	/* virtual */ char *ReadLine(char *buffer, const char *last)
 
	{
 
		return fgets(buffer, size, this->fh);
 
		return fgets(buffer, last - buffer + 1, this->fh);
 
	}
 

	
 
	/* virtual */ void HandlePragma(char *str);
src/strgen/strgen.h
Show inline comments
 
@@ -72,10 +72,10 @@ struct StringReader {
 
	/**
 
	 * Read a single line from the source of strings.
 
	 * @param buffer The buffer to read the data in to.
 
	 * @param size   The size of the buffer.
 
	 * @param last   The last element in the buffer.
 
	 * @return The buffer, or NULL if at the end of the file.
 
	 */
 
	virtual char *ReadLine(char *buffer, size_t size) = 0;
 
	virtual char *ReadLine(char *buffer, const char *last) = 0;
 

	
 
	/**
 
	 * Handle the pragma of the file.
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -821,7 +821,7 @@ void StringReader::ParseFile()
 
	strecpy(_lang.digit_decimal_separator, ".", lastof(_lang.digit_decimal_separator));
 

	
 
	_cur_line = 1;
 
	while (this->ReadLine(buf, sizeof(buf)) != NULL) {
 
	while (this->ReadLine(buf, lastof(buf)) != NULL) {
 
		rstrip(buf);
 
		this->HandleString(buf);
 
		_cur_line++;
0 comments (0 inline, 0 general)