From 84adba018fe8de37e6d4f08db5ab51b505d67673 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 30 Oct 2016 10:37:36 +0100 Subject: core: add FS_PATH_MAX ref: https://github.com/alfredh/baresip/pull/143 --- src/conf.c | 4 ++-- src/core.h | 4 ++++ src/module.c | 2 +- src/play.c | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/conf.c b/src/conf.c index aa6b930..6be861e 100644 --- a/src/conf.c +++ b/src/conf.c @@ -155,7 +155,7 @@ void conf_path_set(const char *path) */ int conf_path_get(char *path, size_t sz) { - char buf[256]; + char buf[FS_PATH_MAX]; int err; /* Use explicit conf path */ @@ -296,7 +296,7 @@ int conf_get_sa(const struct conf *conf, const char *name, struct sa *sa) */ int conf_configure(void) { - char path[256], file[256]; + char path[FS_PATH_MAX], file[FS_PATH_MAX]; int err; #if defined (WIN32) diff --git a/src/core.h b/src/core.h index 422b1ce..2cda010 100644 --- a/src/core.h +++ b/src/core.h @@ -5,6 +5,10 @@ */ +/* max bytes in pathname */ +#define FS_PATH_MAX 256 + + /** * RFC 3551: * diff --git a/src/module.c b/src/module.c index 83964bb..3f6b713 100644 --- a/src/module.c +++ b/src/module.c @@ -57,7 +57,7 @@ static const struct mod_export *find_module(const struct pl *pl) static int load_module(struct mod **modp, const struct pl *modpath, const struct pl *name) { - char file[256]; + char file[FS_PATH_MAX]; struct mod *m = NULL; int err = 0; diff --git a/src/play.c b/src/play.c index 4c1c454..de33499 100644 --- a/src/play.c +++ b/src/play.c @@ -29,12 +29,12 @@ struct play { #ifndef PREFIX #define PREFIX "/usr" #endif -static const char default_play_path[256] = PREFIX "/share/baresip"; +static const char default_play_path[FS_PATH_MAX] = PREFIX "/share/baresip"; struct player { struct list playl; - char play_path[256]; + char play_path[FS_PATH_MAX]; }; -- cgit v1.2.3