diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-06-07 22:43:03 +0200 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-06-07 22:43:48 +0200 |
| commit | 3f0358604e48432b53abf097aa3ab6a1e3639813 (patch) | |
| tree | c132a79507bb39fc37abb49e361f2f720bc69737 /src/buffer.c | |
| parent | 763b838152244c0d7433cde0046e9f67369074e3 (diff) | |
| download | libgit2-3f0358604e48432b53abf097aa3ab6a1e3639813.tar.gz | |
misc: Fix warnings from PVS Studio trial
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 783a36eb8..04aaec3df 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -144,8 +144,9 @@ int git_buf_puts(git_buf *buf, const char *string) int git_buf_vprintf(git_buf *buf, const char *format, va_list ap) { int len; + const size_t expected_size = buf->size + (strlen(format) * 2); - ENSURE_SIZE(buf, buf->size + (strlen(format) * 2)); + ENSURE_SIZE(buf, expected_size); while (1) { va_list args; |
