From 4550f3707bbf845f6f8ecb8deeaf9b3808a1e633 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 16 Sep 2014 06:01:49 +0200 Subject: [PATCH] Cleanups --- dir_list.c | 8 +++----- file_path.c | 8 -------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/dir_list.c b/dir_list.c index 1a177e7549..b91bc4614f 100644 --- a/dir_list.c +++ b/dir_list.c @@ -64,11 +64,9 @@ static int qstrcmp_dir(const void *a_, const void *b_) void dir_list_sort(struct string_list *list, bool dir_first) { - if (!list) - return; - - qsort(list->elems, list->size, sizeof(struct string_list_elem), - dir_first ? qstrcmp_dir : qstrcmp_plain); + if (list) + qsort(list->elems, list->size, sizeof(struct string_list_elem), + dir_first ? qstrcmp_dir : qstrcmp_plain); } void dir_list_free(struct string_list *list) diff --git a/file_path.c b/file_path.c index c25dcb7ed4..4ff3f5911a 100644 --- a/file_path.c +++ b/file_path.c @@ -123,15 +123,11 @@ long read_compressed_file(const char * path, void **buf) const char* file_ext = path_get_extension(archive_path); #ifdef HAVE_7ZIP if (strcasecmp(file_ext,"7z") == 0) - { return read_7zip_file(archive_path,archive_found,buf); - } #endif #ifdef HAVE_ZLIB if (strcasecmp(file_ext,"zip") == 0) - { return read_zip_file(archive_path,archive_found,buf); - } #endif return -1; } @@ -654,8 +650,6 @@ void fill_pathname_expand_special(char *out_path, void fill_short_pathname_representation(char* out_rep, const char *in_path, size_t size) { - - char path_short[PATH_MAX]; fill_pathname(path_short, path_basename(in_path), "", sizeof(path_short)); @@ -674,9 +668,7 @@ void fill_short_pathname_representation(char* out_rep, strlcpy(out_rep,last_hash + 1, size); } else - { strlcpy(out_rep,path_short, size); - } }