diff options
| author | 2013-04-06 19:23:52 (JST) | |
|---|---|---|
| committer | 2013-04-08 23:11:29 (JST) | |
| commit | ed5bd30ebe6921dd22948a3f33a314283f043606 (patch) | |
| tree | 494f1ac8aae7c2147146fefc9aebcdb1bfa671c0 /ui-blob.c | |
| parent | d2e20e38141c882e46eaa77f172fc2ae37a19d3b (diff) | |
| download | cgit-ed5bd30ebe6921dd22948a3f33a314283f043606.zip cgit-ed5bd30ebe6921dd22948a3f33a314283f043606.tar.gz | |
Convert cgit_print_error to a variadic function
This removes many uses of "fmt" which uses a fixed size static pool of
fixed size buffers. Instead of relying on these, we now pass around
argument lists for as long as possible before using a strbuf to render
content of an arbitrary size.
Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-blob.c')
| -rw-r--r-- | ui-blob.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -94,12 +94,12 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
| 94 | 94 | ||
| 95 | if (hex) { | 95 | if (hex) { |
| 96 | if (get_sha1_hex(hex, sha1)) { | 96 | if (get_sha1_hex(hex, sha1)) { |
| 97 | cgit_print_error(fmt("Bad hex value: %s", hex)); | 97 | cgit_print_error("Bad hex value: %s", hex); |
| 98 | return; | 98 | return; |
| 99 | } | 99 | } |
| 100 | } else { | 100 | } else { |
| 101 | if (get_sha1(head, sha1)) { | 101 | if (get_sha1(head, sha1)) { |
| 102 | cgit_print_error(fmt("Bad ref: %s", head)); | 102 | cgit_print_error("Bad ref: %s", head); |
| 103 | return; | 103 | return; |
| 104 | } | 104 | } |
| 105 | } | 105 | } |
| @@ -113,13 +113,13 @@ void cgit_print_blob(const char *hex, char *path, const char *head) | |||
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | if (type == OBJ_BAD) { | 115 | if (type == OBJ_BAD) { |
| 116 | cgit_print_error(fmt("Bad object name: %s", hex)); | 116 | cgit_print_error("Bad object name: %s", hex); |
| 117 | return; | 117 | return; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | buf = read_sha1_file(sha1, &type, &size); | 120 | buf = read_sha1_file(sha1, &type, &size); |
| 121 | if (!buf) { | 121 | if (!buf) { |
| 122 | cgit_print_error(fmt("Error reading object %s", hex)); | 122 | cgit_print_error("Error reading object %s", hex); |
| 123 | return; | 123 | return; |
| 124 | } | 124 | } |
| 125 | 125 | ||
