]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
html.c: add various strbuf and varadic helpers
[ps-cgit] / ui-plain.c
index 8ef4ec6ba525351a6ec6d906e5e3e5e795139c6b..482d53a89f3d02d231f71fbee5d70874a618c1b4 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <stdio.h>
 #include "cgit.h"
+#include "ui-plain.h"
 #include "html.h"
 #include "ui-shared.h"
 
@@ -99,8 +100,9 @@ static int print_object(const unsigned char *sha1, const char *path)
        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;
 }