Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
p5551: add a script to test fetch pack-dir rescans
[gitweb.git]
/
strbuf.h
diff --git
a/strbuf.h
b/strbuf.h
index 80112a8c264a02caf0ffd813557969249ddf25ac..295a6766eba766679cba25ce4889748e348e730d 100644
(file)
--- a/
strbuf.h
+++ b/
strbuf.h
@@
-154,7
+154,10
@@
static inline void strbuf_setlen(struct strbuf *sb, size_t len)
if (len > (sb->alloc ? sb->alloc - 1 : 0))
die("BUG: strbuf_setlen() beyond buffer");
sb->len = len;
- sb->buf[len] = '\0';
+ if (sb->buf != strbuf_slopbuf)
+ sb->buf[len] = '\0';
+ else
+ assert(!strbuf_slopbuf[0]);
}
/**