X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fcmd.c;h=1ba5152d82d8215c2fb47ba5e0ea007b07161fea;hp=7e2b7fa6e01892d2a4541dee977ea3edff371311;hb=faec695d5b7ecf7dd3e4a07ac926ea93ca89020b;hpb=fd17e19672d6df5bdde0568e29ef7c462429735c diff --git a/src/cmd.c b/src/cmd.c index 7e2b7fa..1ba5152 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -50,7 +50,7 @@ bool create_cmdtype_code() CMDCODETAB *np; unsigned hashval; int i; - + for(i = 0; i < cmdcodesize; i++) { np = (CMDCODETAB *) malloc(sizeof(*np)); if(np == NULL) { @@ -128,10 +128,9 @@ bool create_code_type() CMDCODETAB *np; unsigned hashval; int i; - + for(i = 0; i < cmdcodesize; i++) { - np = (CMDCODETAB *) malloc(sizeof(*np)); - if(np == NULL) { + if((np = (CMDCODETAB *) malloc(sizeof(*np))) == NULL) { setcerr(122, NULL); /* cannot create hash table */ return false; }