aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-21 01:54:49 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-21 01:54:49 -0700
commit436edc6eae34b5b70371d87239d7883f41b705a2 (patch)
treec35c4532c49914f1dc69e62eda7f5157446cf5ce /compat
parent1a1fcf4abeb2ed4ef6075970788711cf62405158 (diff)
parenta81892dd8c37b6f13793739721b520fee3ce4c2c (diff)
downloadgit-436edc6eae34b5b70371d87239d7883f41b705a2.tar.gz
git-436edc6eae34b5b70371d87239d7883f41b705a2.tar.xz
Merge branch 'maint'
* maint: compat/snprintf.c: handle snprintf's that always return the # chars transmitted git-svn: fix dcommit to urls with embedded usernames revision.h: make show_early_output an extern which is defined in revision.c
Diffstat (limited to 'compat')
-rw-r--r--compat/snprintf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat/snprintf.c b/compat/snprintf.c
index 580966e56..357e73307 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -17,6 +17,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
if (maxsize > 0) {
ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
/* Windows does not NUL-terminate if result fills buffer */
str[maxsize-1] = 0;
}
@@ -34,6 +36,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
break;
s = str;
ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
}
free(s);
return ret;