ooops! my mistake with missing parenthesis around math!

SVN revision: 40200
This commit is contained in:
Gustavo Sverzut Barbieri 2009-04-18 23:13:33 +00:00
parent 855f5080af
commit 84a4e7a5e5
4 changed files with 14 additions and 14 deletions

View File

@ -403,8 +403,8 @@ _e_fm2_custom_file_info_save(void)
_e_fm2_custom_file_hash_foreach_save, ef);
eet_close(ef);
memcpy(buf2, buf, len - sizeof(".tmp") - 1);
buf2[len - sizeof(".tmp") - 1] = '\0';
memcpy(buf2, buf, len - (sizeof(".tmp") - 1));
buf2[len - (sizeof(".tmp") - 1)] = '\0';
eet_close(_e_fm2_custom_file);
_e_fm2_custom_file = NULL;
ret = rename(buf, buf2);

View File

@ -69,9 +69,9 @@ e_fm_mime_icon_get(const char *mime)
goto try_e_icon_generic;
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "svg", sizeof("svg"));
memcpy(buf + len - (sizeof("edj") - 1), "svg", sizeof("svg"));
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "png", sizeof("png"));
memcpy(buf + len - (sizeof("edj") - 1), "png", sizeof("png"));
if (ecore_file_exists(buf)) goto ok;
try_e_icon_generic:
@ -80,21 +80,21 @@ e_fm_mime_icon_get(const char *mime)
goto try_theme;
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "svg", sizeof("svg"));
memcpy(buf + len - (sizeof("edj") - 1), "svg", sizeof("svg"));
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "png", sizeof("png"));
memcpy(buf + len - (sizeof("edj") - 1), "png", sizeof("png"));
if (ecore_file_exists(buf)) goto ok;
/* 3. look up icon in theme */
try_theme:
memcpy(buf, "e/icons/fileman/mime/", sizeof("e/icons/fileman/mime/") - 1);
ecore_strlcpy(buf + sizeof("e/icons/fileman/mime/") - 1, mime,
sizeof(buf) - sizeof("e/icons/fileman/mime/") - 1);
sizeof(buf) - (sizeof("e/icons/fileman/mime/") - 1));
val = (char *)e_theme_edje_file_get("base/theme/fileman", buf);
if ((val) && (e_util_edje_collection_exists(val, buf))) goto ok;
ecore_strlcpy(buf + sizeof("e/icons/fileman/mime/") - 1, buf2,
sizeof(buf) - sizeof("e/icons/fileman/mime/") - 1);
sizeof(buf) - (sizeof("e/icons/fileman/mime/") - 1));
val = (char *)e_theme_edje_file_get("base/theme/fileman", buf);
if ((val) && (e_util_edje_collection_exists(val, buf))) goto ok;
@ -104,9 +104,9 @@ e_fm_mime_icon_get(const char *mime)
goto try_efreet_icon_generic;
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "svg", sizeof("svg"));
memcpy(buf + len - (sizeof("edj") - 1), "svg", sizeof("svg"));
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "png", sizeof("png"));
memcpy(buf + len - (sizeof("edj") - 1), "png", sizeof("png"));
if (ecore_file_exists(buf)) goto ok;
try_efreet_icon_generic:
@ -115,9 +115,9 @@ e_fm_mime_icon_get(const char *mime)
goto try_efreet_icon_generic;
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "svg", sizeof("svg"));
memcpy(buf + len - (sizeof("edj") - 1), "svg", sizeof("svg"));
if (ecore_file_exists(buf)) goto ok;
memcpy(buf + len - sizeof("edj") - 1, "png", sizeof("png"));
memcpy(buf + len - (sizeof("edj") - 1), "png", sizeof("png"));
if (ecore_file_exists(buf)) goto ok;
return NULL;

View File

@ -266,7 +266,7 @@ _import_edj_gen(Import *import)
if (!fstrip) return;
len = e_user_dir_snprintf(buf, sizeof(buf), "backgrounds/%s.edj", fstrip);
if (len >= sizeof(buf)) return;
off = len - sizeof(".edj") - 1;
off = len - (sizeof(".edj") - 1);
while (ecore_file_exists(buf))
{
snprintf(buf + off, sizeof(buf) - off, "-%d.edj", num);

View File

@ -429,7 +429,7 @@ _import_edj_gen(Import *import)
if (!fstrip) return;
len = e_user_dir_snprintf(buf, sizeof(buf), "backgrounds/%s.edj", fstrip);
if (len >= sizeof(buf)) return;
off = len - sizeof(".edj") - 1;
off = len - (sizeof(".edj") - 1);
while (ecore_file_exists(buf))
{
snprintf(buf + off, sizeof(buf) - off, "-%d.edj", num);