commit 49f25e0108c5b0c565c17f96525ddbfc08bb7fbb
Author: Quentin Rameau <[email protected]>
Date:   Sun Jan 6 14:18:57 2019 +0100

    build-page: fix call to snprintf
    
    Yes, when calling positioned argument, all leading arguments must
    be specified in the format.

diff --git a/build-page.c b/build-page.c
index b466de38..6f0782ae 100644
--- 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\">
");
 


Reply via email to