summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/misc.c b/apps/misc.c
index e2913d53b3..eb821548fe 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -1419,12 +1419,11 @@ int string_option(const char *option, const char *const oplist[], bool ignore_ca
1419} 1419}
1420 1420
1421/* open but with a builtin printf for assembling the path */ 1421/* open but with a builtin printf for assembling the path */
1422int open_pathfmt(int oflag, const char *pathfmt, ...) 1422int open_pathfmt(char *buf, size_t size, int oflag, const char *pathfmt, ...)
1423{ 1423{
1424 static char buf[MAX_PATH];
1425 va_list ap; 1424 va_list ap;
1426 va_start(ap, pathfmt); 1425 va_start(ap, pathfmt);
1427 vsnprintf(buf, sizeof(buf), pathfmt, ap); 1426 vsnprintf(buf, size, pathfmt, ap);
1428 va_end(ap); 1427 va_end(ap);
1429 return open(buf, oflag, 0666); 1428 return open(buf, oflag, 0666);
1430} 1429}