[gxml/gsoc2013] CharacterData.vala: change behaviour when offset == length of string for bounds checking, since the
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml/gsoc2013] CharacterData.vala: change behaviour when offset == length of string for bounds checking, since the
- Date: Sun, 28 Jul 2013 05:33:50 +0000 (UTC)
commit 2295955d12448ba0b682630822170a5dd5f3c624
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]