X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fword.c;h=bae1e82a9d2df0fa32fa02e3cdb49b8e009517bb;hp=df953c5060b0dd8bd728fb8a07a5b81c6a7a2878;hb=d650cc4148ccd23f940ac60050c36c89897c168f;hpb=ce897094478335caf357601548af1b06cbad1188 diff --git a/src/word.c b/src/word.c index df953c5..bae1e82 100644 --- a/src/word.c +++ b/src/word.c @@ -137,14 +137,14 @@ char *word2bit(const WORD word) void print_dumpword(WORD word, bool logicalmode) { - const char *bit = word2bit(word); + char *bit = NULL; if(logicalmode == true) { fprintf(stdout, "%6d", word); } else { fprintf(stdout, "%6d", (signed short)word); } - fprintf(stdout, " = #%04X = %s", word, bit); + fprintf(stdout, " = #%04X = %s", word, (bit = word2bit(word))); /* 「文字の組」の符号表に記載された文字と、改行(CR)/タブを表示 */ if(word >= 0x20 && word <= 0x7E) { fprintf(stdout, " = \'%c\'", word); @@ -153,4 +153,5 @@ void print_dumpword(WORD word, bool logicalmode) } else if(word == '\t') { fprintf(stdout, " = \'\\t\'"); } + FREE(bit); }