diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 2ec93196..ac37ee4b 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -13,6 +13,8 @@ * src/global/data_dir.c (make_relative_prefix): Don't declare. Include libiberty.h. + * src/lib/hex.c (hex_init): Avoid redundant initialization. + 2011-06-30 Mike Frysinger * cmd/cmd_initbus.c (cmd_initbus_complete): Complete bus parameters too. diff --git a/urjtag/src/lib/hex.c b/urjtag/src/lib/hex.c index 5eeafdbd..1f346f85 100644 --- a/urjtag/src/lib/hex.c +++ b/urjtag/src/lib/hex.c @@ -159,8 +159,14 @@ void hex_init (void) { #ifndef HEX_TABLE_INITIALIZED + static bool inited; int i; + if (inited) + return; + + inited = true; + for (i=0; i<_hex_array_size; i++) { switch (i)