Re: [PATCH 14/14] tools lib traceevent: Get rid of die() in somestring conversion funcitons
From: Steven Rostedt
Date:  Mon Dec 09 2013 - 11:24:18 EST
On Mon,  9 Dec 2013 14:34:11 +0900
Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> @@ -2231,12 +2238,13 @@ static char *exp_to_str(struct event_filter *filter, struct filter_arg *arg)
>  		op = "^";
>  		break;
>  	default:
> -		die("oops in exp");
> +		break;
>  	}
This looks like we silently ignored the warning. Perhaps we should have:
	default:
		op = "[ERROR IN EXPRESSION TYPE]";
		break;
-- Steve
>  
>  	len = strlen(op) + strlen(lstr) + strlen(rstr) + 4;
> -	str = malloc_or_die(len);
> -	snprintf(str, len, "%s %s %s", lstr, op, rstr);
> +	str = malloc(len);
> +	if (str)
> +		snprintf(str, len, "%s %s %s", lstr, op, rstr);
>  out:
>  	free(lstr);
>  	free(rstr);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/