]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
Remove redundant calls to fmt("%s", ...)
[ps-cgit] / ui-plain.c
index 8ef4ec6ba525351a6ec6d906e5e3e5e795139c6b..6b0d84b7a0aec7c8762227edf4c35899d2bd2cce 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <stdio.h>
 #include "cgit.h"
+#include "ui-plain.h"
 #include "html.h"
 #include "ui-shared.h"
 
@@ -94,13 +95,14 @@ static int print_object(const unsigned char *sha1, const char *path)
                else
                        ctx.page.mimetype = "text/plain";
        }
-       ctx.page.filename = fmt("%s", path);
+       ctx.page.filename = path;
        ctx.page.size = size;
        ctx.page.etag = sha1_to_hex(sha1);
        cgit_print_http_headers(&ctx);
        html_raw(buf, size);
+       /* If we allocated this, then casting away const is safe. */
        if (freemime)
-               free(ctx.page.mimetype);
+               free((char*) ctx.page.mimetype);
        return 1;
 }