Author: ilor
Date: Sat Apr 4 18:14:27 2009
New Revision: 34468
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34468&view=rev
Log:
first check if pos_separator is valid and *then* access str to avoid a crash.
Modified:
trunk/src/terrain_translation.cpp
Modified: trunk/src/terrain_translation.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/terrain_translation.cpp?rev=34468&r1=34467&r2=34468&view=diff
==============================================================================
--- trunk/src/terrain_translation.cpp (original)
+++ trunk/src/terrain_translation.cpp Sat Apr 4 18:14:27 2009
@@ -314,7 +314,7 @@
result[x][y] = tile;
// Evaluate the separator
- if(utils::isnewline(str[pos_separator]) || pos_separator ==
std::string::npos) {
+ if(pos_separator == std::string::npos ||
utils::isnewline(str[pos_separator])) {
// the first line we set the with the other lines we
check the width
if(y == 0) {
// x contains the offset in the map
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits