fix usage of PATH_MAX when not working with files

SVN revision: 75518
This commit is contained in:
Mike Blumenkrantz 2012-08-22 07:02:41 +00:00
parent b565b6ca04
commit a8beb0950c
17 changed files with 32 additions and 36 deletions

View File

@ -14,10 +14,6 @@
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/shape.h> #include <xcb/shape.h>
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#define WINDOW_WIDTH 320 #define WINDOW_WIDTH 320
#define WINDOW_HEIGHT 240 #define WINDOW_HEIGHT 240
@ -451,7 +447,7 @@ static void
_e_alert_draw_text(void) _e_alert_draw_text(void)
{ {
xcb_void_cookie_t cookie; 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; unsigned int i = 0, j = 0, k = 0;
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),

View File

@ -447,7 +447,7 @@ EAPI void
e_bg_handler_set(Evas_Object *obj __UNUSED__, const char *path, void *data __UNUSED__) e_bg_handler_set(Evas_Object *obj __UNUSED__, const char *path, void *data __UNUSED__)
{ {
E_Container *con; E_Container *con;
char buf[PATH_MAX]; char buf[4096];
int copy = 1; int copy = 1;
E_Zone *zone; E_Zone *zone;
E_Desk *desk; E_Desk *desk;

View File

@ -1148,7 +1148,7 @@ _e_border_frame_replace(E_Border *bd, Eina_Bool argb)
{ {
Ecore_X_Window win; Ecore_X_Window win;
Ecore_Evas *bg_ecore_evas; Ecore_Evas *bg_ecore_evas;
char buf[PATH_MAX]; char buf[4096];
bd->argb = argb; bd->argb = argb;
@ -7554,7 +7554,7 @@ _e_border_eval0(E_Border *bd)
if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername))) if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername)))
{ {
Evas_Object *o; Evas_Object *o;
char buf[PATH_MAX]; char buf[4096];
int ok; int ok;
bd->changes.border = 1; bd->changes.border = 1;

View File

@ -3,7 +3,7 @@
EINTERN int EINTERN int
e_deskenv_init(void) e_deskenv_init(void)
{ {
char buf[PATH_MAX], buf2[PATH_MAX]; char buf[PATH_MAX], buf2[4096];
// run xdrb -load .Xdefaults & .Xresources // run xdrb -load .Xdefaults & .Xresources
// NOTE: one day we should replace this with an e based config + service // NOTE: one day we should replace this with an e based config + service

View File

@ -54,8 +54,8 @@ struct _E_Desklock_Auth
pam_handle_t *handle; pam_handle_t *handle;
} pam; } pam;
char user[PATH_MAX]; char user[4096];
char passwd[PATH_MAX]; char passwd[4096];
}; };
#endif #endif

View File

@ -2,7 +2,7 @@
#define e_error_message_show(args...) do \ #define e_error_message_show(args...) do \
{ \ { \
char __tmpbuf[PATH_MAX]; \ char __tmpbuf[4096]; \
\ \
snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
e_error_message_show_internal(__tmpbuf); \ e_error_message_show_internal(__tmpbuf); \

View File

@ -161,7 +161,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
Eina_List *l, *lnew; Eina_List *l, *lnew;
Ecore_Exe *exe = NULL; Ecore_Exe *exe = NULL;
char *penv_display; char *penv_display;
char buf[PATH_MAX]; char buf[4096];
launch = data; launch = data;
inst = E_NEW(E_Exec_Instance, 1); 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"); "E", "_e_exec_run_error_dialog");
if (dia) if (dia)
{ {
char buf[PATH_MAX]; char buf[4096];
e_dialog_title_set(dia, _("Application run error")); e_dialog_title_set(dia, _("Application run error"));
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
@ -539,7 +539,7 @@ _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_
static void static void
_fill_data(E_Config_Dialog_Data *cfdata) _fill_data(E_Config_Dialog_Data *cfdata)
{ {
char buf[PATH_MAX]; char buf[4096];
if (!cfdata->label) if (!cfdata->label)
{ {
@ -693,7 +693,7 @@ _dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *li
static Evas_Object * static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata) _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; int error_length = 0;
Evas_Object *o, *ob, *os; 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 * static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata) _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 read_length = 0;
int error_length = 0; int error_length = 0;
Evas_Object *o, *of, *ob, *ot; Evas_Object *o, *of, *ob, *ot;

View File

@ -973,7 +973,7 @@ _e_icon_cache_find(Evas_Object *obj, const char *file)
{ {
E_Smart_Data *sd; E_Smart_Data *sd;
Cache_Item *ci; Cache_Item *ci;
char buf[PATH_MAX]; char buf[4096];
const char *id; const char *id;
Eina_List *l; 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))) if (!(sd = evas_object_smart_data_get(obj)))
return EINA_FALSE; 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))) if ((ci = eina_hash_find(_cache->hash, buf)))
{ {

View File

@ -421,7 +421,7 @@ _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj)
EINA_LIST_FOREACH(styles, l, style) EINA_LIST_FOREACH(styles, l, style)
{ {
Evas_Object *thumb, *ow; Evas_Object *thumb, *ow;
char buff[PATH_MAX]; char buff[4096];
thumb = e_livethumb_add(evas); thumb = e_livethumb_add(evas);
e_livethumb_vsize_set(thumb, 120, 40); e_livethumb_vsize_set(thumb, 120, 40);

View File

@ -195,7 +195,7 @@ _xdg_data_dirs_augment(void)
{ {
const char *s = getenv("XDG_DATA_DIRS"); const char *s = getenv("XDG_DATA_DIRS");
const char *p = e_prefix_get(); const char *p = e_prefix_get();
char newpath[PATH_MAX], buf[PATH_MAX]; char newpath[4096], buf[4096];
if (!p) return; if (!p) return;
@ -1296,7 +1296,7 @@ _e_main_parse_arguments(int argc, char **argv)
s = getenv("DISPLAY"); s = getenv("DISPLAY");
if (s) if (s)
{ {
char *p, buff[PATH_MAX]; char *p, buff[4096];
if (!(p = strrchr(s, ':'))) if (!(p = strrchr(s, ':')))
{ {

View File

@ -112,7 +112,7 @@ e_module_new(const char *name)
{ {
E_Module *m; E_Module *m;
char buf[PATH_MAX]; char buf[PATH_MAX];
char body[PATH_MAX], title[1024]; char body[4096], title[1024];
const char *modpath; const char *modpath;
char *s; char *s;
Eina_List *l; Eina_List *l;
@ -502,7 +502,7 @@ static void
_e_module_dialog_disable_show(const char *title, const char *body, E_Module *m) _e_module_dialog_disable_show(const char *title, const char *body, E_Module *m)
{ {
E_Dialog *dia; E_Dialog *dia;
char buf[PATH_MAX]; char buf[4096];
printf("MODULE ERR:\n%s\n", body); printf("MODULE ERR:\n%s\n", body);
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), dia = e_dialog_new(e_container_current_get(e_manager_current_get()),

View File

@ -585,7 +585,7 @@ e_shelf_unsave(E_Shelf *es)
EAPI void EAPI void
e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient) e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient)
{ {
char buf[PATH_MAX]; char buf[4096];
E_OBJECT_CHECK(es); E_OBJECT_CHECK(es);
E_OBJECT_IF_NOT_TYPE(es, E_SHELF_DUMMY_TYPE) 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; E_Shelf *es;
Evas_Object *o; Evas_Object *o;
char buf[PATH_MAX]; char buf[4096];
es = data; es = data;
o = edje_object_add(gcc->gadcon->evas); o = edje_object_add(gcc->gadcon->evas);

View File

@ -45,7 +45,7 @@ static void
_e_startup(void) _e_startup(void)
{ {
Efreet_Desktop *desktop; Efreet_Desktop *desktop;
char buf[PATH_MAX]; char buf[8192];
if (!startup_apps) if (!startup_apps)
{ {

View File

@ -312,7 +312,7 @@ _e_sys_cb_logout_abort(void *data __UNUSED__, E_Dialog *dia)
static void static void
_e_sys_logout_confirm_dialog_update(int remaining) _e_sys_logout_confirm_dialog_update(int remaining)
{ {
char txt[PATH_MAX]; char txt[4096];
if (!_e_sys_logout_confirm_dialog) if (!_e_sys_logout_confirm_dialog)
{ {

View File

@ -152,7 +152,7 @@ static void
_update_machid_get(void) _update_machid_get(void)
{ {
FILE *f; FILE *f;
char buf[PATH_MAX], *c; char buf[4096], *c;
size_t len; size_t len;
f = fopen("/etc/machine-id", "r"); f = fopen("/etc/machine-id", "r");

View File

@ -160,7 +160,7 @@ e_util_head_exec(int head, const char *cmd)
{ {
char *penv_display; char *penv_display;
char *p1, *p2; char *p1, *p2;
char buf[PATH_MAX], buf2[32]; char buf[4096], buf2[32];
int ok = 0; int ok = 0;
Ecore_Exe *exe; Ecore_Exe *exe;
@ -359,7 +359,7 @@ EAPI int
e_util_edje_icon_check(const char *name) e_util_edje_icon_check(const char *name)
{ {
const char *file; const char *file;
char buf[PATH_MAX]; char buf[4096];
if ((!name) || (!name[0])) return 0; if ((!name) || (!name[0])) return 0;
snprintf(buf, sizeof(buf), "e/icons/%s", name); 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) e_util_edje_icon_set(Evas_Object *obj, const char *name)
{ {
const char *file; const char *file;
char buf[PATH_MAX]; char buf[4096];
if ((!name) || (!name[0])) return 0; if ((!name) || (!name[0])) return 0;
snprintf(buf, sizeof(buf), "e/icons/%s", name); 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) _e_util_icon_theme_set(Evas_Object *obj, const char *icon, Eina_Bool fallback)
{ {
const char *file; const char *file;
char buf[PATH_MAX]; char buf[4096];
if ((!icon) || (!icon[0])) return 0; if ((!icon) || (!icon[0])) return 0;
snprintf(buf, sizeof(buf), "e/icons/%s", icon); 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) _e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name, Eina_Bool fallback)
{ {
const char *file; const char *file;
char buf[PATH_MAX]; char buf[4096];
if ((!name) || (!name[0])) return 0; if ((!name) || (!name[0])) return 0;
@ -1246,7 +1246,7 @@ static Eina_Bool
_e_util_conf_timer_old(void *data) _e_util_conf_timer_old(void *data)
{ {
char *module_name = data; char *module_name = data;
char buf[PATH_MAX]; char buf[4096];
char *msg = char *msg =
_("Configuration data needed " _("Configuration data needed "
"upgrading. Your old configuration<br> has been" "upgrading. Your old configuration<br> has been"

View File

@ -6,7 +6,7 @@
#define e_util_dialog_show(title, args...) \ #define e_util_dialog_show(title, args...) \
{ \ { \
char __tmpbuf[PATH_MAX]; \ char __tmpbuf[4096]; \
\ \
snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
e_util_dialog_internal(title, __tmpbuf); \ e_util_dialog_internal(title, __tmpbuf); \