X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fgtk%2Fpswwin.c;h=f0badda26c1d9c9008f5d3f6f572fb5a8ef47e50;hb=f7e3f1d8d0438f52e4f988a12318075cc1b43568;hp=9dd68163aed98d91ef01d17d00f80faa1815cba1;hpb=5419d1bd9d2faae98c78da740634b972e8f5aac1;p=emu8051.git diff --git a/src/gtk/pswwin.c b/src/gtk/pswwin.c index 9dd6816..f0badda 100644 --- a/src/gtk/pswwin.c +++ b/src/gtk/pswwin.c @@ -12,6 +12,7 @@ #endif #include +#include #include "common.h" #include "reg8051.h" @@ -83,7 +84,7 @@ pswwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, guint column; gpointer columnptr; GtkTreeIter iter; - u_int8_t old; + uint8_t old; int new; char str[10]; int bit_index; @@ -109,9 +110,12 @@ pswwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, /* Convert new value (asciihex) to integer. */ new = asciihex2int(new_str); - if ((new != 0) && (new != 1)) { - log_info(" new value: out of range"); - new = old; /* Put back old value... */ + if (asciihex2int_get_error()) { + log_warn(" new value: invalid"); + return; + } else if ((new != 0) && (new != 1)) { + log_warn(" new value: out of range"); + return; } else { log_info(" new value: %d", new); }