[gtkhtml/gtkhtml-4-6: 2/3] Error out if the cursor position becomes negative.



commit d4940d9ddb8ee8d571a0a779fa47811cbea13501
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 13 12:52:21 2016 -0500

    Error out if the cursor position becomes negative.

 gtkhtml/htmlcursor.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtkhtml/htmlcursor.c b/gtkhtml/htmlcursor.c
index ab835a4..d2af641 100644
--- a/gtkhtml/htmlcursor.c
+++ b/gtkhtml/htmlcursor.c
@@ -70,6 +70,10 @@ debug_location (const HTMLCursor *cursor)
        g_print ("Cursor in %s (%p), offset %d, position %d\n",
                 html_type_name (HTML_OBJECT_TYPE (object)),
                 (gpointer) object, cursor->offset, cursor->position);
+
+       if (cursor->position < 0) {
+               g_error ("error! cursor->position < 0");
+       }
 }
 #else
 #define debug_location(cursor)


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