From 3daa13d36f562d9c2ff93b4b68643fc88a446335 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Mon, 1 Feb 2010 00:58:20 +0900 Subject: [PATCH] =?utf8?q?dumpword=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?utf8?q?=E3=81=A7=E6=95=B0=E5=80=A4=E4=BB=A5=E5=A4=96=E3=81=AE=E5=80=A4?= =?utf8?q?=E3=81=8C=E5=BC=95=E6=95=B0=E3=81=AE=E3=81=A8=E3=81=8D=E3=81=AB?= =?utf8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/word.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/word.c b/src/word.c index d2deaee..e4b9af8 100644 --- a/src/word.c +++ b/src/word.c @@ -42,10 +42,14 @@ WORD h2word(const char *str) /* 10進数または16進数の文字列をWORD値に変換 */ WORD a2word(const char *str) { - WORD word = 0x0; + WORD word; + if(!isdigit(*str) && *str != '-' && *str != '#') { + setcerr(114, str); /* not integer */ + return 0x0; + } if(*str == '#') { word = h2word(str); - } else if(isdigit(*str) || *str == '-') { + } else { word = n2word(str); } return word; -- 2.18.0