Author: ilor
Date: Sat Apr 4 18:04:47 2009
New Revision: 34467
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34467&view=rev
Log:
first check if pos_separator is valid and *then* access str to avoid a crash.
Modified:
branches/1.6/src/terrain_translation.cpp
Modified: branches/1.6/src/terrain_translation.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/terrain_translation.cpp?rev=34467&r1=34466&r2=34467&view=diff
==============================================================================
--- branches/1.6/src/terrain_translation.cpp (original)
+++ branches/1.6/src/terrain_translation.cpp Sat Apr 4 18:04:47 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