Commit ce3b044a authored by Masahiko Sakai's avatar Masahiko Sakai

Avioding coredump for an empty input

parent 4b90cdd6
......@@ -147,6 +147,10 @@ int main( int argc, char **argv )
}
fclose( f );//入力の読み込み終了
//以下は使用中ブロックの余ったメモリの初期化処理
if(id==0 && i<=1) { // avoiding errors when null inputs
fprintf( fperror, "Exited due to an empty input\n" );
return(1);
}
if(i==0){
mem[id][0] = op( mem[id-1][59048], mem[id-1][59047] );
mem[id][1] = op( mem[id][0], mem[id-1][59048] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment