tOff-by-one bug fixed in gtk_editable_get_chars() - vaccinewars - be a doctor and try to vaccinate the world
 (HTM) git clone git://src.adamsgaard.dk/vaccinewars
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit ff4bc826cea62613a8a8966e40c40c37d569282f
 (DIR) parent 536650a24c5d17b948826de8eb1ee53cdb69b085
 (HTM) Author: Ben Webb <ben@salilab.org>
       Date:   Mon, 19 Aug 2002 12:48:33 +0000
       
       Off-by-one bug fixed in gtk_editable_get_chars()
       
       
       Diffstat:
         M src/gtkport/gtkport.c               |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
       t@@ -1950,8 +1950,8 @@ gchar *gtk_editable_get_chars(GtkEditable *editable,
          gtk_editable_sync_text(editable);
          if (end_pos < 0 || end_pos >= editable->text->len)
            end_pos = editable->text->len;
       -  copylen = end_pos - start_pos + 1;
       -  retbuf = g_new(gchar, copylen);
       +  copylen = end_pos - start_pos;
       +  retbuf = g_new(gchar, copylen + 1);
        
          memcpy(retbuf, &editable->text->str[start_pos], copylen);
          retbuf[copylen] = '\0';