From 42221db74c2ce57b6452d3b60302fc2b6a6da03c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 27 Dec 2010 15:42:37 +0100 Subject: Use PATH_MAX from limits.h --- src/settings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/settings.c') diff --git a/src/settings.c b/src/settings.c index d181b7a..c6c14f2 100644 --- a/src/settings.c +++ b/src/settings.c @@ -23,11 +23,13 @@ THE SOFTWARE. /* application settings */ +#define _POSIX_C_SOURCE 1 /* PATH_MAX */ #define _BSD_SOURCE /* strdup() */ #include #include #include +#include #include "settings.h" #include "config.h" @@ -89,8 +91,7 @@ void BarSettingsDestroy (BarSettings_t *settings) { * @return nothing yet */ void BarSettingsRead (BarSettings_t *settings) { - /* FIXME: what is the max length of a path? */ - char configfile[1024], key[256], val[256]; + char configfile[PATH_MAX], key[256], val[256]; FILE *configfd; /* _must_ have same order as in BarKeyShortcutId_t */ static const char defaultKeys[] = {'?', '+', '-', 'a', 'c', 'd', 'e', 'g', -- cgit v1.2.3