author | Junio C Hamano <gitster@pobox.com> | |
Mon, 30 May 2011 07:09:41 +0000 (00:09 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 30 May 2011 07:09:41 +0000 (00:09 -0700) |
* jm/maint-misc-fix:
read_gitfile_gently: use ssize_t to hold read result
remove tests of always-false condition
rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
read_gitfile_gently: use ssize_t to hold read result
remove tests of always-false condition
rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
1 | 2 | |||
---|---|---|---|---|
fsck.c | patch | | diff1 | | diff2 | | blob | history |
rerere.c | patch | | diff1 | | diff2 | | blob | history |
setup.c | patch | | diff1 | | diff2 | | blob | history |
transport.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc fsck.c
index 6f266c1ea4b8df503c211170741fa5b490a6a02a,c17a538def23c85e6015f07dc446ff4fb9fda352..60bd4bbf6a2206e2b1991093ea5d84be7f338f73
+++ b/fsck.c
int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
{
va_list ap;
- int len;
struct strbuf sb = STRBUF_INIT;
- strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)");
+ strbuf_addf(&sb, "object %s:", sha1_to_hex(obj->sha1));
va_start(ap, fmt);
- len = vsnprintf(sb.buf + sb.len, strbuf_avail(&sb), fmt, ap);
+ strbuf_vaddf(&sb, fmt, ap);
va_end(ap);
- if (len < 0)
- len = 0;
- if (len >= strbuf_avail(&sb)) {
- strbuf_grow(&sb, len + 2);
- va_start(ap, fmt);
- len = vsnprintf(sb.buf + sb.len, strbuf_avail(&sb), fmt, ap);
- va_end(ap);
- if (len >= strbuf_avail(&sb))
- die("this should not happen, your snprintf is broken");
- }
-
error("%s", sb.buf);
strbuf_release(&sb);
return 1;
diff --cc rerere.c
Simple merge
diff --cc setup.c
Simple merge
diff --cc transport.c
Simple merge