commit 49f25e0108c5b0c565c17f96525ddbfc08bb7fbb
parent cc4a9d2eb6970055a604e6af511f9f58cea5040c
Author: Quentin Rameau <quinq@fifth.space>
Date: Sun, 6 Jan 2019 14:18:57 +0100
build-page: fix call to snprintf
Yes, when calling positioned argument, all leading arguments must
be specified in the format.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/build-page.c b/build-page.c
@@ -223,8 +223,8 @@ menu_panel(char *domain, char *page, char *this, int depth)
d = d_list[l];
if (*d == '.')
continue;
- snprintf(newdir, sizeof(newdir), this ? "%s/%s" : "%2$s",
- this, d);
+ snprintf(newdir, sizeof(newdir), this ? "%2$s/%1$s" : "%s",
+ d, this);
if (!stat_isdir(newdir))
continue;
@@ -271,8 +271,8 @@ print_content(char *domain, char *page)
char index[PATH_MAX];
char *argv[] = { CONVERTER, index, NULL };
- snprintf(index, sizeof(index), page ? "%s/%s" : "%2$s",
- page, "index.md");
+ snprintf(index, sizeof(index), page ? "%2$s/%1$s" : "%s",
+ "index.md", page);
puts("<div id=\"main\">\n");