From 7bf67b046b6fe09db5fdc779cfb1ea2062e78468 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Wed, 4 Aug 2010 12:33:58 +0000 Subject: [PATCH] key and value aren't const SVN revision: 50809 --- legacy/efreet/src/lib/efreet_ini.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/legacy/efreet/src/lib/efreet_ini.c b/legacy/efreet/src/lib/efreet_ini.c index f8ae6b636e..994b57a52d 100644 --- a/legacy/efreet/src/lib/efreet_ini.c +++ b/legacy/efreet/src/lib/efreet_ini.c @@ -197,7 +197,7 @@ efreet_ini_parse(const char *file) if (sep < line_length) { - const char *key, *value; + char *key, *value; int key_end, value_start, value_end; /* trim whitespace from end of key */ @@ -234,16 +234,16 @@ efreet_ini_parse(const char *file) goto next_line; } - key = alloca((key_end + 1) * sizeof(unsigned char)); - value = alloca((value_end - value_start + 1) * sizeof(unsigned char)); + key = alloca(key_end + 1); + value = alloca(value_end - value_start + 1); if (!key || !value) goto next_line; - memcpy((char*)key, line_start, key_end); - ((char*)key)[key_end] = '\0'; + memcpy(key, line_start, key_end); + key[key_end] = '\0'; - memcpy((char*)value, line_start + value_start, + memcpy(value, line_start + value_start, value_end - value_start); - ((char*)value)[value_end - value_start] = '\0'; + value[value_end - value_start] = '\0'; eina_hash_del_by_key(section, key); eina_hash_add(section, key, efreet_ini_unescape(value));