]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
Remove redundant calls to fmt("%s", ...)
[ps-cgit] / ui-plain.c
index 4397a59e3809da6cf71c84ddd5b2c7d3afe94b2e..6b0d84b7a0aec7c8762227edf4c35899d2bd2cce 100644 (file)
@@ -95,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;
 }