summaryrefslogtreecommitdiff
path: root/ws.c
diff options
context:
space:
mode:
Diffstat (limited to 'ws.c')
-rw-r--r--ws.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ws.c b/ws.c
index 7a7ff130a3..b1efcd9d75 100644
--- a/ws.c
+++ b/ws.c
@@ -99,8 +99,7 @@ unsigned whitespace_rule(const char *pathname)
/* The returned string should be freed by the caller. */
char *whitespace_error_string(unsigned ws)
{
- struct strbuf err;
- strbuf_init(&err, 0);
+ struct strbuf err = STRBUF_INIT;
if (ws & WS_TRAILING_SPACE)
strbuf_addstr(&err, "trailing whitespace");
if (ws & WS_SPACE_BEFORE_TAB) {