Only in .: .deps Only in .: Makefile diff -uwbB /tmp/gtkterm-0.99.5/src/buffer.c ./buffer.c --- /tmp/gtkterm-0.99.5/src/buffer.c 2005-09-22 21:33:44.000000000 +0200 +++ ./buffer.c 2007-07-29 18:16:19.000000000 +0200 @@ -58,7 +58,8 @@ GString *buffer_tmp; gchar *in_buffer; - buffer_tmp = g_string_new(chars); + buffer_tmp = g_string_new_len(chars, size); + //buffer_tmp = g_string_new(chars); /* If the auto CR LF mode on, read the buffer to add \r before \n */ diff -uwbB /tmp/gtkterm-0.99.5/src/gtkterm.c ./gtkterm.c --- /tmp/gtkterm-0.99.5/src/gtkterm.c 2003-08-15 14:19:22.000000000 +0200 +++ ./gtkterm.c 2007-07-16 23:40:29.000000000 +0200 @@ -63,7 +63,7 @@ Set_status_message(message); - set_view(ASCII_VIEW); + set_view(HEXADECIMAL_VIEW); gtk_main(); Only in .: gtkterm.diff diff -uwbB /tmp/gtkterm-0.99.5/src/widgets.c ./widgets.c --- /tmp/gtkterm-0.99.5/src/widgets.c 2005-09-22 22:13:00.000000000 +0200 +++ ./widgets.c 2007-07-30 21:56:58.000000000 +0200 @@ -360,13 +360,13 @@ blank_data[bytes_per_line * 3 + 5] = 0; } + + void put_hexadecimal(gchar *string, guint size) { - static gchar data[128]; - static gchar data_byte[6]; + static gchar data[128], data_byte[6]; static guint bytes; glong column, row; - gint i = 0; if(size == 0) @@ -375,28 +375,20 @@ while(i < size) { while(gtk_events_pending()) gtk_main_iteration(); + vte_terminal_get_cursor_position(VTE_TERMINAL(display), &column, &row); - if(show_index) - { - if(column == 0) - /* First byte on line */ + if(row == 0 && column == 0) // First byte on line { + bytes = 0; sprintf(data, "%6d: ", total_bytes); vte_terminal_feed(VTE_TERMINAL(display), data, strlen(data)); - bytes = 0; - } - } - else - { - if(column == 0) - bytes = 0; } /* Print hexadecimal characters */ data[0] = 0; - while(bytes < bytes_per_line && i < size) + while(i < size) { gint avance=0; gchar ascii[1]; @@ -404,7 +396,7 @@ sprintf(data_byte, "%02X ", (guchar)string[i]); vte_terminal_feed(VTE_TERMINAL(display), data_byte, 3); - avance = (bytes_per_line - bytes) * 3 + bytes + 2; + avance = (bytes_per_line - bytes) * 3 + bytes; /* Move forward */ sprintf(data_byte, "%c[%dC", 27, avance); @@ -429,12 +421,17 @@ { vte_terminal_feed(VTE_TERMINAL(display), "\r\n", 2); total_bytes += bytes; + bytes = 0; + if(show_index) + { + sprintf(data, "%6d: ", total_bytes); + vte_terminal_feed(VTE_TERMINAL(display), data, strlen(data)); } - } - } } +} + void put_text(gchar *string, guint size) {