From 40b6618de04615a1f918c6980a3a68809c4c8b47 Mon Sep 17 00:00:00 2001 From: sachiel Date: Sat, 3 Apr 2010 16:26:03 +0000 Subject: [PATCH] Don't screw the still used len variable, and remove unnecessary hash_del (we didn't find the entry at the beginning, no point trying to delete it) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@47726 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/efreet_utils.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/efreet_utils.c b/src/lib/efreet_utils.c index f99ca02..0176b9f 100644 --- a/src/lib/efreet_utils.c +++ b/src/lib/efreet_utils.c @@ -123,7 +123,7 @@ efreet_util_path_in_default(const char *section, const char *path) EAPI const char * efreet_util_path_to_file_id(const char *path) { - size_t len; + size_t len, len2; char *tmp, *p; char *base; const char *file_id; @@ -148,9 +148,9 @@ efreet_util_path_to_file_id(const char *path) return NULL; } - len = strlen(path + len + 1) + 1; - tmp = alloca(len); - memcpy(tmp, path + len + 1, len); + len2 = strlen(path + len + 1) + 1; + tmp = alloca(len2); + memcpy(tmp, path + len + 1, len2); p = tmp; while (*p) { @@ -159,7 +159,6 @@ efreet_util_path_to_file_id(const char *path) } eina_stringshare_del(base); file_id = eina_stringshare_add(tmp); - eina_hash_del(file_id_by_desktop_path, path, NULL); eina_hash_add(file_id_by_desktop_path, path, (void *)file_id); return file_id; } -- 2.7.4