diff options
Diffstat (limited to 'src/H5system.c')
-rw-r--r-- | src/H5system.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/H5system.c b/src/H5system.c index a93a128..2a94028 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -189,7 +189,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) } /* Extra type modifiers */ - if(HDstrchr("ZHhlqLI", *s)) { + if(HDstrchr("zZHhlqLI", *s)) { switch(*s) { /*lint --e{506} Don't issue warnings about constant value booleans */ /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ @@ -203,6 +203,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) break; case 'Z': + case 'z': if(sizeof(size_t) < sizeof(long)) modifier[0] = '\0'; else if(sizeof(size_t) == sizeof(long)) @@ -666,6 +667,30 @@ Wgetlogin() return NULL; } +int c99_snprintf(char* str, size_t size, const char* format, ...) +{ + int count; + va_list ap; + + va_start(ap, format); + count = c99_vsnprintf(str, size, format, ap); + va_end(ap); + + return count; +} + +int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) +{ + int count = -1; + + if (size != 0) + count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); + if (count == -1) + count = _vscprintf(format, ap); + + return count; +} + #endif |