(SDK) Minor cleanups in file_list.c/file_path.c

This commit is contained in:
twinaphex 2015-01-08 21:55:05 +01:00
parent c255387282
commit 7c4307329a
2 changed files with 10 additions and 12 deletions

View File

@ -48,9 +48,9 @@ void file_list_push(file_list_t *list,
size_t file_list_get_size(const file_list_t *list)
{
if (list)
return list->size;
return 0;
if (!list)
return 0;
return list->size;
}
size_t file_list_get_directory_ptr(const file_list_t *list)

View File

@ -69,9 +69,9 @@
const char *path_get_extension(const char *path)
{
const char *ext = strrchr(path_basename(path), '.');
if (ext)
return ext + 1;
return "";
if (!ext)
return "";
return ext + 1;
}
char *path_remove_extension(char *path)
@ -144,13 +144,11 @@ bool path_file_exists(const char *path)
{
FILE *dummy = fopen(path, "rb");
if (dummy)
{
fclose(dummy);
return true;
}
if (!dummy)
return false;
return false;
fclose(dummy);
return true;
}
void fill_pathname(char *out_path, const char *in_path,