[glibmm] Correct the if condition in Gio::MemoryInputStream::add_data().



commit be416f1881aa4a3d0d8be89413c7a5eeb2c83db2
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Mon Jul 27 11:26:35 2009 -0400

    Correct the if condition in Gio::MemoryInputStream::add_data().

 ChangeLog                     |    6 ++++++
 gio/src/memoryinputstream.ccg |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e1f146e..4e15ec5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-27  José Alburquerque  <jaalburqu svn gnome org>
+
+	* gio/src/memoryinputstream.ccg: Correct the if condition in
+	Gio::MemoryInputStream::add_data() to coincide correctly with copying
+	data that is null terminated (as docs say).
+
 2.21.3:
 
 2009-07-27  Jonathon Jongsma  <jonathon jongsma collabora co uk>
diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg
index 00d8bf1..7f6aaf8 100644
--- a/gio/src/memoryinputstream.ccg
+++ b/gio/src/memoryinputstream.ccg
@@ -34,7 +34,7 @@ void MemoryInputStream::add_data(const void* data, gssize len)
   char *data_copy = 0;
 
   // copy the data so that the caller doesn't need to keep the data alive
-  if (len > 0)
+  if (len < 0)
     data_copy = g_strdup (static_cast<const gchar*>(data));
   else
     data_copy = g_strndup (static_cast<const gchar*>(data), len);



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