diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Cast signed chars before ctype calls
A plain char is undefined in the ctype functions for negative values,
which a high byte produces wherever char is signed.
Diffstat (limited to '')
| -rw-r--r-- | source/ui-tree.c | 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 2 insertions, 2 deletions
diff --git a/source/ui-tree.c b/source/ui-tree.c index 9181b1b..f537442 100644 --- a/source/ui-tree.c +++ b/source/ui-tree.c @@ -93,7 +93,7 @@ static void print_binary_buffer(char *buf, unsigned long size) buf[idx] & 0xff); html(" </td><td class='hex'>"); for (idx = 0; idx < ROWLEN && ofs + idx < size; idx++) - ascii[idx] = isgraph(buf[idx]) ? buf[idx] : '.'; + ascii[idx] = isgraph((unsigned char)buf[idx]) ? buf[idx] : '.'; ascii[idx] = '\0'; html_txt(ascii); html("</td></tr>\n"); @@ -271,7 +271,7 @@ static void render_ls_item(const struct object_id *oid, const char *pathname, free(buf); strbuf_release(&linkpath); } - htmlf("</td><td class='ls-size'>%li</td>", size); + htmlf("</td><td class='ls-size'>%lu</td>", size); html("<td>"); cgit_log_link("log", NULL, "button", ctx.qry.head, |
