Skip to content

Commit e51eaef

Browse files
authored
Merge pull request #32898 from compnerd/null-terminate
runtime: correct the `asprintf` shim for Windows
2 parents ffd9dd8 + 37ee73c commit e51eaef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/runtime/ReflectionMirror.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ int asprintf(char **strp, const char *fmt, ...) {
5656
return -1;
5757

5858
length = _vsnprintf(*strp, length, fmt, argp1);
59+
(*strp)[length] = '\0';
5960

6061
va_end(argp0);
6162
va_end(argp1);

0 commit comments

Comments
 (0)