From: Dan Carpenter Date: Sat, 29 Jun 2013 09:19:58 +0000 (+0300) Subject: debug: update debug to handle the new comparison features X-Git-Tag: 1.59~20 X-Git-Url: https://repo.or.cz/w/smatch.git/commitdiff_plain/fd8b1b47929cc54ab7a62d721a3c13d78b3c5796 debug: update debug to handle the new comparison features Signed-off-by: Dan Carpenter --- diff --git a/check_debug.c b/check_debug.c index d42743c1..68194adf 100644 --- a/check_debug.c +++ b/check_debug.c @@ -300,21 +300,21 @@ static void match_compare(const char *fn, struct expression *expr, void *info) struct expression *one, *two; char *one_name, *two_name; int comparison; - const char *str; + char buf[16]; one = get_argument_from_call_expr(expr->args, 0); two = get_argument_from_call_expr(expr->args, 1); comparison = get_comparison(one, two); if (!comparison) - str = ""; + snprintf(buf, sizeof(buf), ""); else - str = show_special(comparison); + snprintf(buf, sizeof(buf), "%s", show_special(comparison)); - one_name = expr_to_var(one); - two_name = expr_to_var(two); + one_name = expr_to_str(one); + two_name = expr_to_str(two); - sm_msg("%s %s %s", one_name, str, two_name); + sm_msg("%s %s %s", one_name, buf, two_name); free_string(one_name); free_string(two_name);