more PATH_MAX cleanups

SVN revision: 75520
This commit is contained in:
Mike Blumenkrantz 2012-08-22 07:32:12 +00:00
parent fcea89adb0
commit 2434f5adbe
28 changed files with 42 additions and 42 deletions

View File

@ -436,7 +436,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class) _gc_id_new(const E_Gadcon_Client_Class *client_class)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name, snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
eina_list_count(backlight_instances) + 1); eina_list_count(backlight_instances) + 1);

View File

@ -87,7 +87,7 @@ str_file_get(const char *file)
FILE *f = fopen(file, "r"); FILE *f = fopen(file, "r");
if (f) if (f)
{ {
char buf[PATH_MAX]; char buf[4096];
char *str = fgets(buf, sizeof(buf), f); char *str = fgets(buf, sizeof(buf), f);
if (str) if (str)
{ {

View File

@ -167,7 +167,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class) _gc_id_new(const E_Gadcon_Client_Class *client_class)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name, snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
eina_list_count(battery_config->instances) + 1); eina_list_count(battery_config->instances) + 1);

View File

@ -21,7 +21,7 @@
#include "e_mod_main.h" #include "e_mod_main.h"
static E_Module *bluez_mod = NULL; static E_Module *bluez_mod = NULL;
static char tmpbuf[PATH_MAX]; /* general purpose buffer, just use immediately */ static char tmpbuf[4096]; /* general purpose buffer, just use immediately */
static const char _e_bluez_agent_path[] = "/org/enlightenment/bluez/Agent"; static const char _e_bluez_agent_path[] = "/org/enlightenment/bluez/Agent";
const char _e_bluez_name[] = "bluez"; const char _e_bluez_name[] = "bluez";

View File

@ -1421,7 +1421,7 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw)
{ {
Evas_Object *o; Evas_Object *o;
int ok = 0; int ok = 0;
char buf[PATH_MAX]; char buf[4096];
Eina_List *list = NULL, *l; Eina_List *list = NULL, *l;
Match *m; Match *m;
const char *title = NULL, *name = NULL, *clas = NULL, *role = NULL; const char *title = NULL, *name = NULL, *clas = NULL, *role = NULL;

View File

@ -351,7 +351,7 @@ _style_selector(Evas *evas,
EINA_LIST_FOREACH(styles, l, style) EINA_LIST_FOREACH(styles, l, style)
{ {
E_Demo_Style_Item *ds_it; E_Demo_Style_Item *ds_it;
char buf[PATH_MAX]; char buf[4096];
ds_it = malloc(sizeof(E_Demo_Style_Item)); ds_it = malloc(sizeof(E_Demo_Style_Item));

View File

@ -219,7 +219,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
EINA_LIST_FREE(borders, str) EINA_LIST_FREE(borders, str)
{ {
char buf[PATH_MAX]; char buf[4096];
ob = e_livethumb_add(evas); ob = e_livethumb_add(evas);
e_livethumb_vsize_set(ob, 96, 96); e_livethumb_vsize_set(ob, 96, 96);

View File

@ -27,7 +27,7 @@
*/ */
static E_Module *connman_mod = NULL; static E_Module *connman_mod = NULL;
static char tmpbuf[PATH_MAX]; /* general purpose buffer, just use immediately */ static char tmpbuf[4096]; /* general purpose buffer, just use immediately */
const char _e_connman_name[] = "connman"; const char _e_connman_name[] = "connman";
const char _e_connman_Name[] = "Connection Manager"; const char _e_connman_Name[] = "Connection Manager";

View File

@ -391,7 +391,7 @@ _menu_cb_post(void *data, E_Menu *m __UNUSED__)
static void static void
_cpufreq_set_governor(const char *governor) _cpufreq_set_governor(const char *governor)
{ {
char buf[PATH_MAX]; char buf[4096];
int ret; int ret;
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
@ -419,7 +419,7 @@ _cpufreq_set_governor(const char *governor)
static void static void
_cpufreq_set_frequency(int frequency) _cpufreq_set_frequency(int frequency)
{ {
char buf[PATH_MAX]; char buf[4096];
int ret; int ret;
#ifdef __FreeBSD__ #ifdef __FreeBSD__
@ -546,7 +546,7 @@ _cpufreq_cb_sort(const void *item1, const void *item2)
static int static int
_cpufreq_status_check_available(Status *s) _cpufreq_status_check_available(Status *s)
{ {
char buf[PATH_MAX]; char buf[4096];
Eina_List *l; Eina_List *l;
// FIXME: this sssumes all cores accept the same freqs/ might be wrong // FIXME: this sssumes all cores accept the same freqs/ might be wrong
#ifdef __FreeBSD__ #ifdef __FreeBSD__
@ -665,7 +665,7 @@ _cpufreq_status_check_available(Status *s)
static int static int
_cpufreq_status_check_current(Status *s) _cpufreq_status_check_current(Status *s)
{ {
char buf[PATH_MAX]; char buf[4096];
int i; int i;
FILE *f; FILE *f;
int ret = 0; int ret = 0;

View File

@ -694,16 +694,16 @@ _fetch(Evry_Plugin *plugin, const char *input)
_free_files(p); _free_files(p);
strncpy(buf, p->directory, PATH_MAX); strncpy(buf, p->directory, sizeof(buf));
_folder_item_add(p, p->directory, prio++); _folder_item_add(p, p->directory, prio++);
while (strlen(buf) > 1) while (strlen(buf) > 1)
{ {
buf[PATH_MAX - 1] = 0; buf[PATH_MAX] = 0;
dir = dirname(buf); dir = dirname(buf);
_folder_item_add(p, dir, prio++); _folder_item_add(p, dir, prio++);
strncpy(buf, dir, PATH_MAX); strncpy(buf, dir, sizeof(buf));
} }
p->command = CMD_SHOW_PARENT; p->command = CMD_SHOW_PARENT;

View File

@ -846,7 +846,7 @@ evry_file_url_get(Evry_Item_File *file)
if (!file->path) if (!file->path)
return NULL; return NULL;
memset(dest, 0, PATH_MAX * 3 + 7); memset(dest, 0, sizeof(dest));
snprintf(dest, 8, "file://"); snprintf(dest, 8, "file://");

View File

@ -617,7 +617,7 @@ _e_fwin_icon_popup(void *data)
E_Fwin *fwin = data; E_Fwin *fwin = data;
Evas_Object *bg, *edje, *list, *o; Evas_Object *bg, *edje, *list, *o;
E_Zone *zone; E_Zone *zone;
char buf[PATH_MAX]; char buf[4096];
int x, y, w, h, mw, mh, fx, fy, px, py; int x, y, w, h, mw, mh, fx, fy, px, py;
fwin->popup_timer = NULL; fwin->popup_timer = NULL;
@ -1313,7 +1313,7 @@ _e_fwin_config_set(E_Fwin_Page *page)
static void static void
_e_fwin_window_title_set(E_Fwin_Page *page) _e_fwin_window_title_set(E_Fwin_Page *page)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX + sizeof("e_fwin::")];
const char *file; const char *file;
if (!page) return; if (!page) return;
@ -2028,7 +2028,7 @@ _e_fwin_file_open_dialog(E_Fwin_Page *page,
Efreet_Desktop *desk = NULL; Efreet_Desktop *desk = NULL;
E_Fwin_Apps_Dialog *fad; E_Fwin_Apps_Dialog *fad;
E_Fm2_Icon_Info *ici; E_Fm2_Icon_Info *ici;
char buf[PATH_MAX]; char buf[PATH_MAX + sizeof("removable:")];
Eina_Bool has_default = EINA_FALSE; Eina_Bool has_default = EINA_FALSE;
int need_dia = 0, n = 0;; int need_dia = 0, n = 0;;
@ -2700,7 +2700,7 @@ _e_fwin_op_registry_listener_cb(void *data,
const E_Fm2_Op_Registry_Entry *ere) const E_Fm2_Op_Registry_Entry *ere)
{ {
Evas_Object *o = data; Evas_Object *o = data;
char buf[PATH_MAX]; char buf[4096];
char *total; char *total;
int mw, mh; int mw, mh;

View File

@ -276,7 +276,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class __UNUSED__) _gc_id_new(const E_Gadcon_Client_Class *client_class __UNUSED__)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", _gc_class.name, snprintf(buf, sizeof(buf), "%s.%d", _gc_class.name,
(eina_list_count(instances) + 1)); (eina_list_count(instances) + 1));

View File

@ -306,7 +306,7 @@ _e_mod_menu_volume_cb(void *data,
} }
else else
{ {
char buf[PATH_MAX]; char buf[PATH_MAX + sizeof("removable:")];
snprintf(buf, sizeof(buf), "removable:%s", vol->udi); snprintf(buf, sizeof(buf), "removable:%s", vol->udi);
if (fm && ((fileman_config->view.open_dirs_in_place && evas_object_data_get(fm, "page_is_window")) || if (fm && ((fileman_config->view.open_dirs_in_place && evas_object_data_get(fm, "page_is_window")) ||
@ -321,7 +321,7 @@ static void
_e_mod_fileman_parse_gtk_bookmarks(E_Menu *m, _e_mod_fileman_parse_gtk_bookmarks(E_Menu *m,
Eina_Bool need_separator) Eina_Bool need_separator)
{ {
char line[PATH_MAX]; char line[4096];
char buf[PATH_MAX]; char buf[PATH_MAX];
E_Menu_Item *mi; E_Menu_Item *mi;
Efreet_Uri *uri; Efreet_Uri *uri;

View File

@ -53,7 +53,7 @@ static void
_opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere) _opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere)
{ {
Evas_Object *o = data; Evas_Object *o = data;
char *total, buf[PATH_MAX]; char *total, buf[4096];
if (!o || !ere) return; if (!o || !ere) return;

View File

@ -233,7 +233,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class) _gc_id_new(const E_Gadcon_Client_Class *client_class)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name, snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
eina_list_count(ibox_config->instances) + 1); eina_list_count(ibox_config->instances) + 1);

View File

@ -285,7 +285,7 @@ _il_home_desktop_run(Il_Home_Win *hwin, Efreet_Desktop *desktop)
Il_Home_Exec *exec; Il_Home_Exec *exec;
Eina_List *l; Eina_List *l;
E_Border *bd; E_Border *bd;
char buff[PATH_MAX]; char buff[4096];
if ((!hwin) || (!desktop) || (!desktop->exec)) return; if ((!hwin) || (!desktop) || (!desktop->exec)) return;
EINA_LIST_FOREACH(exes, l, exec) EINA_LIST_FOREACH(exes, l, exec)

View File

@ -940,7 +940,7 @@ static void
_e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout) _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
{ {
FILE *f; FILE *f;
char buf[PATH_MAX]; char buf[4096];
int isok = 0; int isok = 0;
E_Kbd_Int_Key *ky = NULL; E_Kbd_Int_Key *ky = NULL;
E_Kbd_Int_Key_State *st = NULL; E_Kbd_Int_Key_State *st = NULL;
@ -1010,7 +1010,7 @@ _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
(!strcmp(str, "capslock")) || (!strcmp(str, "altgr"))) (!strcmp(str, "capslock")) || (!strcmp(str, "altgr")))
{ {
char *p; char *p;
char label[PATH_MAX]; char label[4096];
if (sscanf(buf, "%*s %4000s", label) != 1) continue; if (sscanf(buf, "%*s %4000s", label) != 1) continue;
st = calloc(1, sizeof(E_Kbd_Int_Key_State)); st = calloc(1, sizeof(E_Kbd_Int_Key_State));

View File

@ -113,7 +113,7 @@ _e_mod_kbd_device_ignore_load(void)
static void static void
_e_mod_kbd_device_ignore_load_file(const char *file) _e_mod_kbd_device_ignore_load_file(const char *file)
{ {
char buff[PATH_MAX]; char buff[4096];
FILE *f; FILE *f;
/* can this file be opened */ /* can this file be opened */

View File

@ -8,7 +8,7 @@ static void _mixer_popup_timer_new(E_Mixer_Instance *inst);
static Eina_Bool _mixer_popup_timer_cb(void *data); static Eina_Bool _mixer_popup_timer_cb(void *data);
static E_Module *mixer_mod = NULL; static E_Module *mixer_mod = NULL;
static char tmpbuf[PATH_MAX]; /* general purpose buffer, just use immediately */ static char tmpbuf[4096]; /* general purpose buffer, just use immediately */
static const char _conf_domain[] = "module.mixer"; static const char _conf_domain[] = "module.mixer";
static const char _name[] = "mixer"; static const char _name[] = "mixer";

View File

@ -4,7 +4,7 @@
#include "e_mod_main.h" #include "e_mod_main.h"
static E_Module *ofono_mod = NULL; static E_Module *ofono_mod = NULL;
static char tmpbuf[PATH_MAX]; static char tmpbuf[4096];
const char _e_ofono_name[] = "ofono"; const char _e_ofono_name[] = "ofono";
const char _e_ofono_Name[] = N_("Mobile Modems Info"); const char _e_ofono_Name[] = N_("Mobile Modems Info");

View File

@ -281,7 +281,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class) _gc_id_new(const E_Gadcon_Client_Class *client_class)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name, snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
eina_list_count(pager_config->instances) + 1); eina_list_count(pager_config->instances) + 1);

View File

@ -107,7 +107,7 @@ static int _last_st_num = -1;
static E_Module *systray_mod = NULL; static E_Module *systray_mod = NULL;
static Instance *instance = NULL; /* only one systray ever possible */ static Instance *instance = NULL; /* only one systray ever possible */
static char tmpbuf[PATH_MAX]; /* general purpose buffer, just use immediately */ static char tmpbuf[4096]; /* general purpose buffer, just use immediately */
static Eina_Bool static Eina_Bool
_systray_site_is_safe(E_Gadcon_Site site) _systray_site_is_safe(E_Gadcon_Site site)

View File

@ -301,7 +301,7 @@ _temperature_face_id_max(const Eina_Hash *hash __UNUSED__, const void *key, void
void void
temperature_face_update_config(Config_Face *inst) temperature_face_update_config(Config_Face *inst)
{ {
char buf[PATH_MAX]; char buf[8192];
if (inst->tempget_exe) if (inst->tempget_exe)
{ {

View File

@ -358,7 +358,7 @@ check(void)
FILE *f; FILE *f;
int ret = 0; int ret = 0;
int temp = 0; int temp = 0;
char buf[PATH_MAX]; char buf[4096];
#ifdef __FreeBSD__ #ifdef __FreeBSD__
int len; int len;
size_t ftemp = 0; size_t ftemp = 0;

View File

@ -32,7 +32,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
while (fgets(buf, sizeof(buf), fin)) while (fgets(buf, sizeof(buf), fin))
{ {
Efreet_Desktop *desk; Efreet_Desktop *desk;
char name[PATH_MAX], buf2[PATH_MAX], *p; char name[4096], buf2[PATH_MAX], *p;
int n; int n;
if (buf[0] == '#') continue; if (buf[0] == '#') continue;

View File

@ -540,7 +540,7 @@ _dlg_add_cb_ok(void *data __UNUSED__, E_Dialog *dlg)
{ {
E_Config_Dialog_Data *cfdata = dlg->data; E_Config_Dialog_Data *cfdata = dlg->data;
E_Config_XKB_Layout *cl; E_Config_XKB_Layout *cl;
char buf[PATH_MAX]; char buf[4096];
/* Configuration information */ /* Configuration information */
const char *layout = e_widget_ilist_selected_value_get(cfdata->layout_list); const char *layout = e_widget_ilist_selected_value_get(cfdata->layout_list);
const char *model = e_widget_ilist_selected_value_get(cfdata->model_list); const char *model = e_widget_ilist_selected_value_get(cfdata->model_list);
@ -602,7 +602,7 @@ _cb_dlg_fill_delay(void *data)
E_Config_Dialog_Data *cfdata; E_Config_Dialog_Data *cfdata;
Eina_List *l; Eina_List *l;
E_XKB_Layout *layout; E_XKB_Layout *layout;
char buf[PATH_MAX]; char buf[4096];
if (!(cfdata = data)) return ECORE_CALLBACK_RENEW; if (!(cfdata = data)) return ECORE_CALLBACK_RENEW;
@ -645,7 +645,7 @@ _cb_layout_select(void *data)
Eina_List *l; Eina_List *l;
const char *label; const char *label;
int n; int n;
char buf[PATH_MAX]; char buf[4096];
if (!(cfdata = data)) return; if (!(cfdata = data)) return;
@ -708,7 +708,7 @@ _cb_fill_delay(void *data)
E_Config_XKB_Layout *cl; E_Config_XKB_Layout *cl;
E_XKB_Model *model; E_XKB_Model *model;
int n = 0; int n = 0;
char buf[PATH_MAX]; char buf[4096];
if (!(cfdata = data)) return ECORE_CALLBACK_RENEW; if (!(cfdata = data)) return ECORE_CALLBACK_RENEW;

View File

@ -258,7 +258,7 @@ _gc_label(const E_Gadcon_Client_Class *client_class __UNUSED__)
static const char * static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class) _gc_id_new(const E_Gadcon_Client_Class *client_class)
{ {
static char buf[PATH_MAX]; static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name, snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
eina_list_count(instances) + 1); eina_list_count(instances) + 1);
@ -362,7 +362,7 @@ _e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
E_Menu_Item *mi; E_Menu_Item *mi;
Eina_List *l; Eina_List *l;
int dir; int dir;
char buf[PATH_MAX]; char buf[4096];
int grp = -1; int grp = -1;
mi = e_menu_item_new(inst->lmenu); mi = e_menu_item_new(inst->lmenu);