Fixed the print_num() not to write null terminator.