diff options
author | Marco Paland <info@paland.com> | 2018-04-17 15:57:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 15:57:28 +0200 |
commit | 3a924ada73d7c38a0fe1635a8e8eac8b4cc62e3c (patch) | |
tree | a574aea85f373fcbb366e2d0fb2566452b47cbb0 | |
parent | 896b2ce07b6ea0660408fc5698026c8a3af3aa3d (diff) | |
parent | 422b420b4d72282eb5b3adb4c5756e45be0dd03d (diff) | |
download | printf-3a924ada73d7c38a0fe1635a8e8eac8b4cc62e3c.tar.gz printf-3a924ada73d7c38a0fe1635a8e8eac8b4cc62e3c.tar.bz2 printf-3a924ada73d7c38a0fe1635a8e8eac8b4cc62e3c.zip |
Merge pull request #10 from Leandros/size_t_support
add support for size_t flag: %zd/%zu
-rw-r--r-- | printf.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -425,6 +425,10 @@ static size_t _vsnprintf(char* buffer, size_t buffer_len, const char* format, va flags |= FLAGS_LONG_LONG;
format++;
}
+ if ((*format == 'z')) {
+ flags |= (sizeof(size_t) == 8 ? FLAGS_LONG_LONG : FLAGS_LONG);
+ format++;
+ }
// evaluate specifier
switch (*format) {
|