Commit 8aab36a3010372edec71e8c765d4ecfd848c09b6

Edward Thomson 2015-02-12T22:14:53

filebuf: use an int for return check

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/filebuf.c b/src/filebuf.c
index 932b8c7..a35b59c 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -446,10 +446,10 @@ int git_filebuf_printf(git_filebuf *file, const char *format, ...)
 	}
 
 	va_start(arglist, format);
-	len = p_vsnprintf(tmp_buffer, len + 1, format, arglist);
+	written = p_vsnprintf(tmp_buffer, len + 1, format, arglist);
 	va_end(arglist);
 
-	if (len < 0) {
+	if (written < 0) {
 		git__free(tmp_buffer);
 		file->last_error = BUFERR_MEM;
 		return -1;