Add option no-define to AM_INIT_AUTOMAKE
[emu8051.git] / src / gtk / pswwin.c
index 9dd6816..f0badda 100644 (file)
@@ -12,6 +12,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdint.h>
 
 #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);
        }