diff --git a/build-support/factor.sh b/build-support/factor.sh index 3ece72306a..ba5815cfc1 100755 --- a/build-support/factor.sh +++ b/build-support/factor.sh @@ -205,7 +205,7 @@ find_architecture() { write_test_program() { echo "#include " > $C_WORD.c - echo "int main(){printf(\"%ld\", 8*sizeof(void*)); return 0; }" >> $C_WORD.c + echo "int main(){printf(\"%ld\", (long)(8*sizeof(void*))); return 0; }" >> $C_WORD.c } c_find_word_size() { diff --git a/vm/debug.c b/vm/debug.c index 6f7e883785..a9afd2c3c0 100755 --- a/vm/debug.c +++ b/vm/debug.c @@ -414,7 +414,7 @@ void factorbug(void) if(strcmp(cmd,"d") == 0) { CELL addr = read_cell_hex(); - scanf(" "); + if(scanf(" ") < 0) break; CELL count = read_cell_hex(); dump_memory(addr,addr+count); } diff --git a/vm/utilities.c b/vm/utilities.c index d97b540884..ac52772b4e 100755 --- a/vm/utilities.c +++ b/vm/utilities.c @@ -50,6 +50,6 @@ void print_fixnum(F_FIXNUM x) CELL read_cell_hex(void) { CELL cell; - scanf(CELL_HEX_FORMAT,&cell); + if(scanf(CELL_HEX_FORMAT,&cell) < 0) exit(1); return cell; };