diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-03-06 12:01:17 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-03-06 12:01:17 +0000 |
commit | c6c6cd0ffdae8ae95ade377317bbc1604ed09169 (patch) | |
tree | 849cdeed163eef0be0f5448dfd2b6b8d49d0de13 /src | |
parent | 97de458ff00ec1a0f618054fd8fb9129b991192e (diff) | |
download | openocd_libswd-c6c6cd0ffdae8ae95ade377317bbc1604ed09169.tar.gz openocd_libswd-c6c6cd0ffdae8ae95ade377317bbc1604ed09169.tar.bz2 openocd_libswd-c6c6cd0ffdae8ae95ade377317bbc1604ed09169.tar.xz openocd_libswd-c6c6cd0ffdae8ae95ade377317bbc1604ed09169.zip |
Michael Bruck: 64 bit va_list fix for crash
git-svn-id: svn://svn.berlios.de/openocd/trunk@451 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/log.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/helper/log.c b/src/helper/log.c index b3898723..5127a373 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -284,9 +284,12 @@ char *alloc_printf(const char *fmt, va_list ap) free(t); return NULL; } - + + va_list ap_copy; + va_copy(ap_copy, ap); + int ret; - ret = vsnprintf(string, size, fmt, ap); + ret = vsnprintf(string, size, fmt, ap_copy); /* NB! The result of the vsnprintf() might be an *EMPTY* string! */ if ((ret >= 0) && ((ret + 1) < size)) break; |