From 53b9e09f0b30e4f53ec492b345cbd1ab85afe929 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 27 Oct 2008 14:21:49 -0700 Subject: Fix the argument passed for printf %c formats This fix was noted in the comments to bug 6851, but for some reason it was not applied when originally committed. --- ChangeLog | 5 +++++ translate.cxx | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index fc7018b8..4db3af2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-27 Josh Stone + + * translate.cxx (c_unparser::visit_print_format): Fix the argument passed + for printf %c formats. + 2008-10-27 Rajan Arora * elaborate.cxx (add_global_var_display): Added check for globals diff --git a/translate.cxx b/translate.cxx index bbd8a01b..ee6b21cb 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4196,6 +4196,9 @@ c_unparser::visit_print_format (print_format* e) /* The type of the %m argument is 'char*'. */ if (components[i].type == print_format::conv_memory) o->line() << ", (char*)(uintptr_t)" << tmp[arg_ix++].value(); + /* The type of the %c argument is 'int'. */ + else if (components[i].type == print_format::conv_char) + o->line() << ", (int)" << tmp[arg_ix++].value(); else o->line() << ", " << tmp[arg_ix++].value(); } -- cgit