diff options
| author | Russell Belfer <rb@github.com> | 2012-12-20 16:15:02 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-01-04 15:47:43 -0800 |
| commit | 6f58332f3ab04f910103b945348b6a0a314c1793 (patch) | |
| tree | 335dbed65cdc3fee19b99405ecb386ea61ec3d60 /src/stash.c | |
| parent | a6a82e1a59065f6d5eaf4748708c92326048a99f (diff) | |
| download | libgit2-6f58332f3ab04f910103b945348b6a0a314c1793.tar.gz | |
Fix use of uninitialized variable
Diffstat (limited to 'src/stash.c')
| -rw-r--r-- | src/stash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stash.c b/src/stash.c index e67f7038c..dbd626a60 100644 --- a/src/stash.c +++ b/src/stash.c @@ -401,8 +401,8 @@ static int prepare_worktree_commit_message( git_buf buf = GIT_BUF_INIT; int error; - if (git_buf_set(&buf, git_buf_cstr(msg), git_buf_len(msg)) < 0) - return -1; + if ((error = git_buf_set(&buf, git_buf_cstr(msg), git_buf_len(msg))) < 0) + return error; git_buf_clear(msg); @@ -419,7 +419,7 @@ static int prepare_worktree_commit_message( git_buf_printf(msg, ": %s\n", user_message); } - error = git_buf_oom(msg) || git_buf_oom(&buf) ? -1 : 0; + error = (git_buf_oom(msg) || git_buf_oom(&buf)) ? -1 : 0; cleanup: git_buf_free(&buf); |
