From 204d13af02cf97b93376d2bd3d59e33a4c935015 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 24 Jul 2006 17:49:53 +0000 Subject: [PATCH] fix format string parser [r8045] --- ir/ir/irprintf.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ir/ir/irprintf.c b/ir/ir/irprintf.c index bbd968ad9..5ebfd1204 100644 --- a/ir/ir/irprintf.c +++ b/ir/ir/irprintf.c @@ -478,18 +478,27 @@ static void ir_common_vprintf(const appender_t *app, void *object, case 'h': len_str = "h"; len = len_short; - if((ch = fmt[++i]) == 'h') { + ++i; + if((ch = fmt[i]) == 'h') { len_str = "hh"; len = len_char; + ++i; } break; case 'l': len_str = "l"; len = len_long; - if((ch = fmt[++i]) == 'l') { + ++i; + if ((ch = fmt[i]) == 'l') { len_str = "ll"; len = len_long_long; + ++i; + } + else if ((ch = fmt[i]) == 'u') { + len_str = "lu"; + len = len_long_long; + ++i; } break; -- 2.20.1