X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fpgmwin.c;h=0e8961bd0d51d92a65174cd08e80908d898416de;hb=359b0be02becb952016f0f79f6e608c7737378e7;hp=09a6e835fb8f32cef13bd43b179d7b91d2abe832;hpb=8b2f6f3ebba84564f11f0087f257c94133c107fa;p=emu8051.git diff --git a/src/pgmwin.c b/src/pgmwin.c index 09a6e83..0e8961b 100644 --- a/src/pgmwin.c +++ b/src/pgmwin.c @@ -273,9 +273,14 @@ pgmwin_refresh(void) InstSize = cpu8051_get_instruction_size(OpCode); /* Display instruction hex bytes. */ - for (k = 0, col_id = COL_B0; k < InstSize; k++, col_id++) { - int2asciihex(memory_read8(PGM_MEM_ID, Address + k), - str, 2); + for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) { + if (k < InstSize) + int2asciihex(memory_read8(PGM_MEM_ID, + Address + k), + str, 2); + else + str[0] = '\0'; + gtk_list_store_set(store, &iter, col_id, str, -1); }