[gxml/gsoc2013: 121/150] CharacterData.vala: change behaviour when offset == length of string for bounds checking, since the



commit b080d87235e9427af708910fb4ccdf54261dec82
Author: Richard Schwarting <aquarichy gmail com>
Date:   Sun Jul 28 01:30:11 2013 -0400

    CharacterData.vala: change behaviour when offset == length of string for bounds checking, since the end 
of a string is a fit place to insert things (but perhaps not remove :D)

 gxml/CharacterData.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gxml/CharacterData.vala b/gxml/CharacterData.vala
index bc71242..503b4d9 100644
--- a/gxml/CharacterData.vala
+++ b/gxml/CharacterData.vala
@@ -85,7 +85,7 @@ namespace GXml {
                                        return false;
                                }
                        } else {
-                               if (length <= offset) { // <= or < ?
+                               if (length < offset) { // <= or < ? we need < for CharacterData.insert_data 
(str.len, "blah"); when appending, but maybe CharacterData.insert_data should length as str.len+1 to 
check_index_size? 
                                        GXml.warning (DomException.INDEX_SIZE, "%s called with offset '%lu' 
for data of length '%lu'".printf (method, offset, length));
                                        return false;
                                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]