author | Lars Hjemli <hjemli@gmail.com> | 2007-09-19 21:46:59 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-09-19 21:46:59 (UTC) |
commit | 63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3 (patch) (side-by-side diff) | |
tree | d6b31c994f861579e6d7085ba52a41a37cd69868 | |
parent | 7921572fb1fd28ec7523fcf5ed03eaf8a3432e65 (diff) | |
download | cgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.zip cgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.tar.gz cgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.tar.bz2 |
ui-tree: specify parameter position for all htmlf formats
The GNU C library manual tells us that behavior is undefined if only
some formats has a specification for the parameter position.
Noticed-by: <mkraai@beckman.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -22,49 +22,49 @@ static void print_object(const unsigned char *sha1, char *path) if (type == OBJ_BAD) { cgit_print_error(fmt("Bad object name: %s", sha1_to_hex(sha1))); return; } buf = read_sha1_file(sha1, &type, &size); if (!buf) { cgit_print_error(fmt("Error reading object %s", sha1_to_hex(sha1))); return; } html(" blob: <a href='"); html_attr(cgit_pageurl(cgit_query_repo, "blob", fmt("id=%s", sha1_to_hex(sha1)))); htmlf("'>%s</a>",sha1_to_hex(sha1)); html("<table class='blob'>\n"); idx = 0; start = 0; lineno = 0; while(idx < size) { if (buf[idx] == '\n') { buf[idx] = '\0'; - htmlf("<tr><td class='no'><a name='%d'>%1$d</a></td><td class='txt'>", + htmlf("<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>", ++lineno); html_txt(buf + start); html("</td></tr>\n"); start = idx + 1; } idx++; } html("</table>\n"); } static int ls_item(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned int mode, int stage) { char *name; char *fullpath; enum object_type type; unsigned long size = 0; name = xstrdup(pathname); fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "", cgit_query_path ? "/" : "", name); type = sha1_object_info(sha1, &size); |