From a8beb0950cc96d1589d8540e10fc389b0676f5f7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 22 Aug 2012 07:02:41 +0000 Subject: [PATCH] fix usage of PATH_MAX when not working with files SVN revision: 75518 --- src/bin/e_alert_main.c | 6 +----- src/bin/e_bg.c | 2 +- src/bin/e_border.c | 4 ++-- src/bin/e_deskenv.c | 2 +- src/bin/e_desklock.c | 4 ++-- src/bin/e_error.h | 2 +- src/bin/e_exec.c | 10 +++++----- src/bin/e_icon.c | 4 ++-- src/bin/e_int_shelf_config.c | 2 +- src/bin/e_main.c | 4 ++-- src/bin/e_module.c | 4 ++-- src/bin/e_shelf.c | 4 ++-- src/bin/e_startup.c | 2 +- src/bin/e_sys.c | 2 +- src/bin/e_update.c | 2 +- src/bin/e_utils.c | 12 ++++++------ src/bin/e_utils.h | 2 +- 17 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/bin/e_alert_main.c b/src/bin/e_alert_main.c index 635b847ae..bb62d1719 100644 --- a/src/bin/e_alert_main.c +++ b/src/bin/e_alert_main.c @@ -14,10 +14,6 @@ #include #include -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - #define WINDOW_WIDTH 320 #define WINDOW_HEIGHT 240 @@ -451,7 +447,7 @@ static void _e_alert_draw_text(void) { xcb_void_cookie_t cookie; - char warn[1024], msg[PATH_MAX], line[1024]; + char warn[1024], msg[4096], line[1024]; unsigned int i = 0, j = 0, k = 0; snprintf(msg, sizeof(msg), diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c index 401621b5d..4b1bd3a00 100644 --- a/src/bin/e_bg.c +++ b/src/bin/e_bg.c @@ -447,7 +447,7 @@ EAPI void e_bg_handler_set(Evas_Object *obj __UNUSED__, const char *path, void *data __UNUSED__) { E_Container *con; - char buf[PATH_MAX]; + char buf[4096]; int copy = 1; E_Zone *zone; E_Desk *desk; diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 08e695f23..d37133586 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -1148,7 +1148,7 @@ _e_border_frame_replace(E_Border *bd, Eina_Bool argb) { Ecore_X_Window win; Ecore_Evas *bg_ecore_evas; - char buf[PATH_MAX]; + char buf[4096]; bd->argb = argb; @@ -7554,7 +7554,7 @@ _e_border_eval0(E_Border *bd) if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername))) { Evas_Object *o; - char buf[PATH_MAX]; + char buf[4096]; int ok; bd->changes.border = 1; diff --git a/src/bin/e_deskenv.c b/src/bin/e_deskenv.c index e08f248e2..ca96cf44b 100644 --- a/src/bin/e_deskenv.c +++ b/src/bin/e_deskenv.c @@ -3,7 +3,7 @@ EINTERN int e_deskenv_init(void) { - char buf[PATH_MAX], buf2[PATH_MAX]; + char buf[PATH_MAX], buf2[4096]; // run xdrb -load .Xdefaults & .Xresources // NOTE: one day we should replace this with an e based config + service diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index eb794b184..1ef77f381 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -54,8 +54,8 @@ struct _E_Desklock_Auth pam_handle_t *handle; } pam; - char user[PATH_MAX]; - char passwd[PATH_MAX]; + char user[4096]; + char passwd[4096]; }; #endif diff --git a/src/bin/e_error.h b/src/bin/e_error.h index 70e617be5..205b7d40f 100644 --- a/src/bin/e_error.h +++ b/src/bin/e_error.h @@ -2,7 +2,7 @@ #define e_error_message_show(args...) do \ { \ - char __tmpbuf[PATH_MAX]; \ + char __tmpbuf[4096]; \ \ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \ e_error_message_show_internal(__tmpbuf); \ diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c index 7052df4fe..051d502bf 100644 --- a/src/bin/e_exec.c +++ b/src/bin/e_exec.c @@ -161,7 +161,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) Eina_List *l, *lnew; Ecore_Exe *exe = NULL; char *penv_display; - char buf[PATH_MAX]; + char buf[4096]; launch = data; inst = E_NEW(E_Exec_Instance, 1); @@ -427,7 +427,7 @@ _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event) "E", "_e_exec_run_error_dialog"); if (dia) { - char buf[PATH_MAX]; + char buf[4096]; e_dialog_title_set(dia, _("Application run error")); snprintf(buf, sizeof(buf), @@ -539,7 +539,7 @@ _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_ static void _fill_data(E_Config_Dialog_Data *cfdata) { - char buf[PATH_MAX]; + char buf[4096]; if (!cfdata->label) { @@ -693,7 +693,7 @@ _dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *li static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata) { - char buf[PATH_MAX]; + char buf[4096]; int error_length = 0; Evas_Object *o, *ob, *os; @@ -736,7 +736,7 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial static Evas_Object * _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata) { - char buf[PATH_MAX]; + char buf[4096]; int read_length = 0; int error_length = 0; Evas_Object *o, *of, *ob, *ot; diff --git a/src/bin/e_icon.c b/src/bin/e_icon.c index 7fa926140..9ad07888d 100644 --- a/src/bin/e_icon.c +++ b/src/bin/e_icon.c @@ -973,7 +973,7 @@ _e_icon_cache_find(Evas_Object *obj, const char *file) { E_Smart_Data *sd; Cache_Item *ci; - char buf[PATH_MAX]; + char buf[4096]; const char *id; Eina_List *l; @@ -982,7 +982,7 @@ _e_icon_cache_find(Evas_Object *obj, const char *file) if (!(sd = evas_object_smart_data_get(obj))) return EINA_FALSE; - snprintf(buf, PATH_MAX, "%d:%s", sd->size, file); + snprintf(buf, sizeof(buf), "%d:%s", sd->size, file); if ((ci = eina_hash_find(_cache->hash, buf))) { diff --git a/src/bin/e_int_shelf_config.c b/src/bin/e_int_shelf_config.c index 0e5dd8729..e1539362a 100644 --- a/src/bin/e_int_shelf_config.c +++ b/src/bin/e_int_shelf_config.c @@ -421,7 +421,7 @@ _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj) EINA_LIST_FOREACH(styles, l, style) { Evas_Object *thumb, *ow; - char buff[PATH_MAX]; + char buff[4096]; thumb = e_livethumb_add(evas); e_livethumb_vsize_set(thumb, 120, 40); diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 103df289c..3b217a885 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -195,7 +195,7 @@ _xdg_data_dirs_augment(void) { const char *s = getenv("XDG_DATA_DIRS"); const char *p = e_prefix_get(); - char newpath[PATH_MAX], buf[PATH_MAX]; + char newpath[4096], buf[4096]; if (!p) return; @@ -1296,7 +1296,7 @@ _e_main_parse_arguments(int argc, char **argv) s = getenv("DISPLAY"); if (s) { - char *p, buff[PATH_MAX]; + char *p, buff[4096]; if (!(p = strrchr(s, ':'))) { diff --git a/src/bin/e_module.c b/src/bin/e_module.c index 65f08ca8f..ba1d99a77 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -112,7 +112,7 @@ e_module_new(const char *name) { E_Module *m; char buf[PATH_MAX]; - char body[PATH_MAX], title[1024]; + char body[4096], title[1024]; const char *modpath; char *s; Eina_List *l; @@ -502,7 +502,7 @@ static void _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) { E_Dialog *dia; - char buf[PATH_MAX]; + char buf[4096]; printf("MODULE ERR:\n%s\n", body); dia = e_dialog_new(e_container_current_get(e_manager_current_get()), diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index 4d33e4bd7..dacd59ff4 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -585,7 +585,7 @@ e_shelf_unsave(E_Shelf *es) EAPI void e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient) { - char buf[PATH_MAX]; + char buf[4096]; E_OBJECT_CHECK(es); E_OBJECT_IF_NOT_TYPE(es, E_SHELF_DUMMY_TYPE) @@ -1235,7 +1235,7 @@ _e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *styl { E_Shelf *es; Evas_Object *o; - char buf[PATH_MAX]; + char buf[4096]; es = data; o = edje_object_add(gcc->gadcon->evas); diff --git a/src/bin/e_startup.c b/src/bin/e_startup.c index a11b52c46..2702bc35e 100644 --- a/src/bin/e_startup.c +++ b/src/bin/e_startup.c @@ -45,7 +45,7 @@ static void _e_startup(void) { Efreet_Desktop *desktop; - char buf[PATH_MAX]; + char buf[8192]; if (!startup_apps) { diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c index c23537fa5..40b93159a 100644 --- a/src/bin/e_sys.c +++ b/src/bin/e_sys.c @@ -312,7 +312,7 @@ _e_sys_cb_logout_abort(void *data __UNUSED__, E_Dialog *dia) static void _e_sys_logout_confirm_dialog_update(int remaining) { - char txt[PATH_MAX]; + char txt[4096]; if (!_e_sys_logout_confirm_dialog) { diff --git a/src/bin/e_update.c b/src/bin/e_update.c index 50dcfc583..68bb61a62 100644 --- a/src/bin/e_update.c +++ b/src/bin/e_update.c @@ -152,7 +152,7 @@ static void _update_machid_get(void) { FILE *f; - char buf[PATH_MAX], *c; + char buf[4096], *c; size_t len; f = fopen("/etc/machine-id", "r"); diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 956d2a160..dd07f15de 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -160,7 +160,7 @@ e_util_head_exec(int head, const char *cmd) { char *penv_display; char *p1, *p2; - char buf[PATH_MAX], buf2[32]; + char buf[4096], buf2[32]; int ok = 0; Ecore_Exe *exe; @@ -359,7 +359,7 @@ EAPI int e_util_edje_icon_check(const char *name) { const char *file; - char buf[PATH_MAX]; + char buf[4096]; if ((!name) || (!name[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", name); @@ -375,7 +375,7 @@ EAPI int e_util_edje_icon_set(Evas_Object *obj, const char *name) { const char *file; - char buf[PATH_MAX]; + char buf[4096]; if ((!name) || (!name[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", name); @@ -392,7 +392,7 @@ static int _e_util_icon_theme_set(Evas_Object *obj, const char *icon, Eina_Bool fallback) { const char *file; - char buf[PATH_MAX]; + char buf[4096]; if ((!icon) || (!icon[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", icon); @@ -455,7 +455,7 @@ int _e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name, Eina_Bool fallback) { const char *file; - char buf[PATH_MAX]; + char buf[4096]; if ((!name) || (!name[0])) return 0; @@ -1246,7 +1246,7 @@ static Eina_Bool _e_util_conf_timer_old(void *data) { char *module_name = data; - char buf[PATH_MAX]; + char buf[4096]; char *msg = _("Configuration data needed " "upgrading. Your old configuration
has been" diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 759d12cad..338bd97db 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -6,7 +6,7 @@ #define e_util_dialog_show(title, args...) \ { \ - char __tmpbuf[PATH_MAX]; \ + char __tmpbuf[4096]; \ \ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \ e_util_dialog_internal(title, __tmpbuf); \