# define EINTERN
# endif
-#ifndef strdupa
-# define strdupa(str) strcpy(alloca(strlen(str) + 1), str)
-#endif
-
-#ifndef strndupa
-# define strndupa(str, len) strncpy(alloca(len + 1), str, len)
-#endif
-
typedef struct _E_Before_Idler E_Before_Idler;
typedef struct _E_Rect E_Rect;
{
Efreet_Desktop *desktop = NULL;
char *p, *p2;
+ size_t plen;
- p2 = strdupa(params);
+ plen = strlen(params);
+ p2 = memcpy(alloca(plen + 1), params, plen + 1);
p = strchr(p2, ':');
if (p)
{
e_fm2_parent_go(Evas_Object *obj)
{
char *p, *path;
+ char buf[PATH_MAX];
EFM_SMART_CHECK();
if (!sd->path) return;
- path = strdupa(sd->path);
+ path = memcpy(buf, sd->path, strlen(sd->path + 1));
if ((p = strrchr(path, '/'))) *p = 0;
if (*path)
e_fm2_path_set(obj, sd->dev, path);
tb[tblen + 1] = '\0';
}
else
- tb = strdupa(sd->typebuf.buf);
+ {
+ size_t blen = strlen(sd->typebuf.buf);
+ tb = memcpy(alloca(blen + 1), sd->typebuf.buf, blen + 1);
+ }
if (!next)
{
#include "e_fm_shared_codec.h"
#define DEF_MOD_BACKOFF 0.2
-#ifndef strdupa
-# define strdupa(str) strcpy(alloca(strlen(str) + 1), str)
-#endif
-
typedef struct _E_Dir E_Dir;
typedef struct _E_Fop E_Fop;
typedef struct _E_Mod E_Mod;
FILE *info = NULL;
const char *filename;
const char *escname = NULL;
- char *dest, *trash_dir;
- char buf[4096];
+ char *dest;
+ char buf[4096], trash_dir[4096];
unsigned int i = 0;
struct tm *lt;
time_t t;
if (!fop) return 0;
/* Check that 'home trash' and subsequesnt dirs exists, create if not */
- snprintf(buf, sizeof(buf), "%s/Trash", efreet_data_home_get());
- trash_dir = strdupa(buf);
+ snprintf(trash_dir, sizeof(trash_dir), "%s/Trash", efreet_data_home_get());
snprintf(buf, sizeof(buf), "%s/files", trash_dir);
if (!ecore_file_mkpath(buf)) return 0;
snprintf(buf, sizeof(buf), "%s/info", trash_dir);
#undef E_TYPEDEFS
#include "e_fm_op.h"
-#ifndef strdupa
-# define strdupa(str) strcpy(alloca(strlen(str) + 1), str)
-#endif
-
#define READBUFSIZE 65536
#define COPYBUFSIZE 16384
#define REMOVECHUNKSIZE 4096
_e_fm_op_copy_link(E_Fm_Op_Task *task)
{
char *lnk_path;
+ size_t lnk_len;
lnk_path = ecore_file_readlink(task->src.name);
if (!lnk_path)
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot read link '%s'.", task->src.name);
}
+ lnk_len = strlen(lnk_path);
+
E_FM_OP_DEBUG("Creating link from '%s' to '%s'\n", lnk_path, task->dst.name);
_e_fm_op_update_progress_report_simple(0, lnk_path, task->dst.name);
}
if (symlink(lnk_path, task->dst.name) == -1)
{
- buf = strdupa(lnk_path);
+ buf = memcpy(alloca(lnk_len + 1), lnk_path, lnk_len + 1);
free(lnk_path);
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot create link from '%s' to '%s': %s.", buf, task->dst.name);
}
}
else
{
- buf = strdupa(lnk_path);
+ buf = memcpy(alloca(lnk_len + 1), lnk_path, lnk_len + 1);
free(lnk_path);
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot create link from '%s' to '%s': %s.", buf, task->dst.name);
}
int fd, num = 1;
int w = 0, h = 0;
const char *file, *locale;
- char buf[PATH_MAX], cmd[PATH_MAX], tmpn[PATH_MAX], ipart[PATH_MAX], enc[128];
+ char buf[PATH_MAX], fbuf[PATH_MAX], cmd[PATH_MAX], tmpn[PATH_MAX], ipart[PATH_MAX], enc[128];
Eina_Tmpstr *path = NULL;
char *imgdir = NULL, *fstrip;
int cr, cg, cb, ca;
if (import->external)
{
- fstrip = strdupa(e_util_filename_escape(import->file));
+ const char *esc = e_util_filename_escape(import->file);
+ fstrip = memcpy(fbuf, esc, strlen(esc) + 1);
snprintf(enc, sizeof(enc), "USER");
}
else
{
- fstrip = strdupa(e_util_filename_escape(file));
+ const char *esc = e_util_filename_escape(file);
+ fstrip = memcpy(fbuf, esc, strlen(esc) + 1);
if (import->quality == 100)
snprintf(enc, sizeof(enc), "COMP");
else
{
Eina_Hash *alias_hash;
char *alias;
- char *lower_language;
+ char llbuf[256];
+ char *lower_language = llbuf;
if ((!language) || (!strncmp(language, "POSIX", strlen("POSIX"))))
return strdup("C");
if (!alias_hash) /* No alias file available */
return strdup(language);
- lower_language = strdupa(language);
+ strcpy(lower_language, language);
eina_str_tolower(&lower_language);
-
alias = eina_hash_find(alias_hash, lower_language);
if (alias)
EINA_LIST_FREE(list, s)
{
char *trans, *p, *p2;
+ size_t slen;
- trans = strdupa(s);
+ slen = strlen(s);
+ trans = memcpy(alloca(slen + 1), s, slen + 1);
p = trans + len + 1;
if (*p)
{
{
char *p;
const char *pp;
+ char buf[PATH_MAX];
pp = strchr(s, '/');
pp = pp ? pp + 1 : s;
- p = strdupa(pp);
+ p = memcpy(buf, pp, strlen(pp) + 1);
p[0] = toupper(p[0]);
ob = e_widget_radio_add(evas, _(p), mode, rg);
e_widget_list_object_append(o, ob, 1, 0, 0.5);
static void
_profile_change(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
{
- char buf[PATH_MAX];
- char *dir;
+ char buf[PATH_MAX], buf2[PATH_MAX];
Efreet_Desktop *desk = NULL;
- e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s", profile);
- dir = strdupa(buf);
- snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
+ e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", profile);
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2);
desk = efreet_desktop_new(buf);
if (desk)
{
for (i = 0, l = profiles; l; l = l->next)
{
Efreet_Desktop *desk = NULL;
- char buf[PATH_MAX], *prof;
- const char *label, *dir;
+ char buf[PATH_MAX], buf2[PATH_MAX], *prof;
+ const char *label;
Evas_Object *ic;
prof = l->data;
continue;
}
}
- e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s", prof);
+ e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", prof);
// if it's not a system profile - don't offer it
- if (!ecore_file_is_dir(buf))
+ if (!ecore_file_is_dir(buf2))
{
free(prof);
continue;
}
- dir = strdupa(buf);
if (!strcmp(prof, "standard")) sel = i;
- snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2);
desk = efreet_desktop_new(buf);
label = prof;
if ((desk) && (desk->name)) label = desk->name;
- snprintf(buf, sizeof(buf), "%s/icon.edj", dir);
+ snprintf(buf, sizeof(buf), "%s/icon.edj", buf2);
if ((desk) && (desk->icon))
{
if (eina_str_has_extension(desk->icon, "png"))
- snprintf(buf, sizeof(buf), "%s/%s", dir, desk->icon);
+ snprintf(buf, sizeof(buf), "%s/%s", buf2, desk->icon);
else
- snprintf(buf, sizeof(buf), "%s/%s.png", dir, desk->icon);
+ snprintf(buf, sizeof(buf), "%s/%s.png", buf2, desk->icon);
}
else
e_prefix_data_concat_static(buf, "data/images/enlightenment.png");