diff options
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/settings.c | 5 |
2 files changed, 5 insertions, 4 deletions
@@ -41,6 +41,7 @@ THE SOFTWARE. #include <pthread.h> #include <assert.h> #include <stdbool.h> +#include <limits.h> /* pandora.com library */ #include <piano.h> @@ -397,8 +398,7 @@ static void BarMainLoop (BarApp_t *app) { int main (int argc, char **argv) { static BarApp_t app; - /* FIXME: max path length? */ - char ctlPath[1024]; + char ctlPath[PATH_MAX]; /* terminal attributes _before_ we started messing around with ~ECHO */ struct termios termOrig; 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 <string.h> #include <stdlib.h> #include <stdio.h> +#include <limits.h> #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', |