diff options
| author | Charles Forsyth <charles.forsyth@gmail.com> | 2014-06-30 10:57:08 +0100 |
|---|---|---|
| committer | Charles Forsyth <charles.forsyth@gmail.com> | 2014-06-30 10:57:08 +0100 |
| commit | 3cd4f1d15146c08f05206d6328ecbc1c7fdc8dfa (patch) | |
| tree | a546acadca10b43d6b5eafc6d85f4aed361e9988 /libkern/vsnprint.c | |
| parent | ee030d07b2cf167be70f1dc36f56bdf3012860ae (diff) | |
update to match lib9
Diffstat (limited to 'libkern/vsnprint.c')
| -rw-r--r-- | libkern/vsnprint.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libkern/vsnprint.c b/libkern/vsnprint.c index 841d142c..2006cfb3 100644 --- a/libkern/vsnprint.c +++ b/libkern/vsnprint.c @@ -12,6 +12,7 @@ * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. */ #include "lib9.h" +#include "fmtdef.h" int vsnprint(char *buf, int len, char *fmt, va_list args) @@ -27,8 +28,9 @@ vsnprint(char *buf, int len, char *fmt, va_list args) f.flush = nil; f.farg = nil; f.nfmt = 0; - f.args = args; + va_copy(f.args, args); dofmt(&f, fmt); + va_end(f.args); *(char*)f.to = '\0'; return (char*)f.to - buf; } |
