summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2010-12-27 15:42:37 +0100
committerLars-Dominik Braun <lars@6xq.net>2010-12-27 15:42:37 +0100
commit42221db74c2ce57b6452d3b60302fc2b6a6da03c (patch)
tree4a495c5d965e4f6fcfb7bd390b7cd3319171f156 /src/settings.c
parenteadc96008ca6fa0a335ab35daaff0cfd24546cf9 (diff)
downloadpianobar-42221db74c2ce57b6452d3b60302fc2b6a6da03c.tar.gz
pianobar-42221db74c2ce57b6452d3b60302fc2b6a6da03c.tar.bz2
pianobar-42221db74c2ce57b6452d3b60302fc2b6a6da03c.zip
Use PATH_MAX from limits.h
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c5
1 files changed, 3 insertions, 2 deletions
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',