[ghex] findreplace: fix jump w/ files >= INT_MAX bytes.



commit 5373da64fd2dc0541246fca72d07875830d96ea5
Author: Logan Rathbone <poprocks gmail com>
Date:   Mon Dec 20 22:32:36 2021 -0500

    findreplace: fix jump w/ files >= INT_MAX bytes.

 src/findreplace.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/findreplace.c b/src/findreplace.c
index 69a4c36..da9c423 100644
--- a/src/findreplace.c
+++ b/src/findreplace.c
@@ -308,7 +308,8 @@ goto_byte_cb (GtkButton *button, gpointer user_data)
        gint64 cursor_pos;
        GtkEntry *entry;
        GtkEntryBuffer *buffer;
-       int byte = 2, len, i;
+       gint64 byte = 2;
+       int len, i;
        int is_relative = 0;
        gboolean is_hex;
        const gchar *byte_str;
@@ -367,8 +368,8 @@ goto_byte_cb (GtkButton *button, gpointer user_data)
        }
 
        if((i == len) &&
-          ((sscanf(byte_str, "0x%x", &byte) == 1) ||
-               (sscanf(byte_str, "%d", &byte) == 1))) {
+          ((sscanf(byte_str, "0x%lx", &byte) == 1) ||
+               (sscanf(byte_str, "%ld", &byte) == 1))) {
                if(is_relative) {
                        if(is_relative == -1 && byte > cursor_pos) {
                                display_error_dialog(parent,


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