summary refs log tree commit diff
path: root/archive.h
diff options
context:
space:
mode:
Diffstat (limited to 'archive.h')
-rw-r--r--archive.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/archive.h b/archive.h
index ffe1561..6342236 100644
--- a/archive.h
+++ b/archive.h
@@ -143,10 +143,10 @@ int templateRender(
 );
 char *templateURL(const char *template, const struct Variable vars[]);
 
-static inline char *
-pathUID(char path[static PATH_MAX], uint32_t uid, const char *type) {
-	snprintf(path, PATH_MAX, "UID/%" PRIu32 ".%s", uid, type);
-	return path;
+static inline const char *pathUID(uint32_t uid, const char *type) {
+	static char buf[PATH_MAX];
+	snprintf(buf, sizeof(buf), "UID/%" PRIu32 ".%s", uid, type);
+	return buf;
 }
 
 static inline const char *pathMangle(const char *messageID) {
@@ -159,18 +159,16 @@ static inline const char *pathMangle(const char *messageID) {
 	return buf;
 }
 
-static inline char *pathMessage(
-	char path[static PATH_MAX], const char *messageID, const char *type
-) {
-	snprintf(path, PATH_MAX, "message/%s.%s", pathMangle(messageID), type);
-	return path;
+static inline const char *pathMessage(const char *messageID, const char *type) {
+	static char buf[PATH_MAX];
+	snprintf(buf, sizeof(buf), "message/%s.%s", pathMangle(messageID), type);
+	return buf;
 }
 
-static inline char *pathThread(
-	char path[static PATH_MAX], const char *messageID, const char *type
-) {
-	snprintf(path, PATH_MAX, "thread/%s.%s", pathMangle(messageID), type);
-	return path;
+static inline const char *pathThread(const char *messageID, const char *type) {
+	static char buf[PATH_MAX];
+	snprintf(buf, sizeof(buf), "thread/%s.%s", pathMangle(messageID), type);
+	return buf;
 }
 
 #define MBOX_HEADERS \