summaryrefslogtreecommitdiff
path: root/ecos
diff options
context:
space:
mode:
authorschodet2008-01-14 15:38:12 +0000
committerschodet2008-01-14 15:38:12 +0000
commitdf017f4b31240cbf9b3b134634c0f4b9bb693b1e (patch)
treefd8ad2dc44cf5c8ee46d5df57870979c6fdcdcb1 /ecos
parent31f29f7492248e07049db05767fdf81be96a5c20 (diff)
* ecos:
- fixed bug in snprintf. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1263 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'ecos')
-rw-r--r--ecos/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/ecos/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx b/ecos/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx
index 988e1160a5..34c75c9946 100644
--- a/ecos/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx
+++ b/ecos/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx
@@ -122,7 +122,9 @@ vsnprintf( char *s, size_t size, const char *format, va_list arg ) __THROW
// Null-terminate it, but note that s has been changed by str_write(), so
// that it now points to the end of the string
- s[0] = '\0';
+ // NSc: should not write if size is 0.
+ if (size != 0)
+ s[0] = '\0';
return rc;