summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Samptur <arvind.samptur@wipro.com>2003-07-31 10:08:49 +0000
committerArvind Samptur <arvind@src.gnome.org>2003-07-31 10:08:49 +0000
commita06900f20ea7a56d89cb1f856281f3910f125fdf (patch)
tree304c6cd9f76a65beec37b49049c8f4cc4b832c11
parent826419e4a6fc904a2218e63642c1048ddc529810 (diff)
downloadmetacity-a06900f20ea7a56d89cb1f856281f3910f125fdf.tar.gz
Number of strings we are processing is one more than required.
2003-07-29 Arvind Samptur <arvind.samptur@wipro.com> * src/xprops.c (utf8_list_from_results): Number of strings we are processing is one more than required. Also get the string count right even without a null byte at the end. Pointed out by Havoc.
-rw-r--r--ChangeLog8
-rw-r--r--src/xprops.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 14e1e214..8d024b9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-07-29 Arvind Samptur <arvind.samptur@wipro.com>
+
+ * src/xprops.c (utf8_list_from_results): Number of
+ strings we are processing is one more than required.
+
+ Also get the string count right even without a null byte at the end.
+ Pointed out by Havoc.
+
2003-07-21 Arafat Medini <lumina@silverpen.de>
* ar.po: Added "ar" Arabic to ALL_LINGUAS
diff --git a/src/xprops.c b/src/xprops.c
index 9083054a..2b00c5ae 100644
--- a/src/xprops.c
+++ b/src/xprops.c
@@ -451,7 +451,7 @@ utf8_list_from_results (GetPropertyResults *results,
* property is nul-separated
*/
i = 0;
- n_strings = 1;
+ n_strings = 0;
while (i < (int) results->n_items)
{
if (results->prop[i] == '\0')
@@ -459,6 +459,9 @@ utf8_list_from_results (GetPropertyResults *results,
++i;
}
+ if (results->prop[n_items - 1] != '\0')
+ ++n_strings;
+
/* we're guaranteed that results->prop has a nul on the end
* by XGetWindowProperty
*/