Adding '\0' at buffer ends in test_file