aboutsummaryrefslogtreecommitdiff
path: root/ui-view.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-view.c')
-rw-r--r--ui-view.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui-view.c b/ui-view.c
index 9d23c45..85e223c 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -11,7 +11,7 @@
void cgit_print_view(const char *hex)
{
unsigned char sha1[20];
- enum object_type type;
+ char type[20];
unsigned char *buf;
unsigned long size;
@@ -20,22 +20,20 @@ void cgit_print_view(const char *hex)
return;
}
- type = sha1_object_info(sha1, &size);
- if (type == OBJ_BAD) {
- cgit_print_error(fmt("Bad object name: %s", hex));
+ if (sha1_object_info(sha1, type, &size)){
+ cgit_print_error("Bad object name");
return;
}
- buf = read_sha1_file(sha1, &type, &size);
+ buf = read_sha1_file(sha1, type, &size);
if (!buf) {
- cgit_print_error(fmt("Error reading object %s", hex));
+ cgit_print_error("Error reading object");
return;
}
buf[size] = '\0';
html("<table class='list'>\n");
- htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n",
- typename(type), hex, size);
+ htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size);
html("<tr><td class='blob'>\n");
html_txt(buf);
html("\n</td></tr>\n");