summaryrefslogtreecommitdiff
path: root/ui-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r--ui-snapshot.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 9be5dbe..a47884e 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -100,11 +100,11 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
unsigned char sha1[20];
if (get_sha1(hex, sha1)) {
- cgit_print_error(fmt("Bad object id: %s", hex));
+ cgit_print_error("Bad object id: %s", hex);
return 1;
}
if (!lookup_commit_reference(sha1)) {
- cgit_print_error(fmt("Not a commit reference: %s", hex));
+ cgit_print_error("Not a commit reference: %s", hex);
return 1;
}
ctx.page.mimetype = xstrdup(format->mimetype);
@@ -154,13 +154,18 @@ static const char *get_ref_from_filename(const char *url, const char *filename,
return NULL;
}
-static void show_error(char *msg)
+__attribute__((format (printf, 1, 2)))
+static void show_error(char *fmt, ...)
{
+ va_list ap;
+
ctx.page.mimetype = "text/html";
cgit_print_http_headers(&ctx);
cgit_print_docstart(&ctx);
cgit_print_pageheader(&ctx);
- cgit_print_error(msg);
+ va_start(ap, fmt);
+ cgit_vprint_error(fmt, ap);
+ va_end(ap);
cgit_print_docend();
}
@@ -177,8 +182,7 @@ void cgit_print_snapshot(const char *head, const char *hex,
f = get_format(filename);
if (!f) {
- show_error(xstrdup(fmt("Unsupported snapshot format: %s",
- filename)));
+ show_error("Unsupported snapshot format: %s", filename);
return;
}
x/parser.pyx?id=efd5aa7d6e66cc1ab201d5fc5933787a7c8690b5&follow=1'>Fixed the unicode support and stuff ... and also made eix faster :)René 'Necoro' Neumann1-20/+22 2010-04-14Disable debug messages by defaultRené 'Necoro' Neumann1-1/+1 2010-04-13Better eix error inheritance and handlingRené 'Necoro' Neumann1-2/+9 2010-04-13Fix the handling of FilterSets. Fixes bug #558887.René 'Necoro' Neumann2-56/+64 Now FilterSets are a subclass of InstalledSet. And return only these packages, which are installed ... but then all of them. 2010-04-12Updated newsRené 'Necoro' Neumann1-0/+1 2010-04-13Added my name to translators list.Clement Bourgeois1-0/+1