From a430c4030377d360f01941bce7bca04e5fc1684c Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 23 Sep 2016 06:50:22 +0100 Subject: [PATCH] Bug in Windows swift_vasprintf() --- stdlib/public/runtime/Errors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/public/runtime/Errors.cpp b/stdlib/public/runtime/Errors.cpp index e45c5bf08a9b5..1b88d7b224c1c 100644 --- a/stdlib/public/runtime/Errors.cpp +++ b/stdlib/public/runtime/Errors.cpp @@ -242,7 +242,7 @@ static int swift_vasprintf(char **strp, const char *fmt, va_list ap) { char *buffer = reinterpret_cast(malloc(len + 1)); if (!buffer) return -1; - int result = vsprintf(*strp, fmt, ap); + int result = vsprintf(buffer, fmt, ap); if (result < 0) { free(buffer); return -1;