[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201012181415.48560c8e@oasis.local.home>
Date: Mon, 12 Oct 2020 18:14:15 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Tom Zanussi <zanussi@...nel.org>
Cc: axelrasmussen@...gle.com, mhiramat@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/7] tracing: Handle synthetic event array field type
checking correctly
On Mon, 12 Oct 2020 15:18:08 -0500
Tom Zanussi <zanussi@...nel.org> wrote:
> @@ -630,8 +630,11 @@ static struct synth_field *parse_synth_field(int argc, const char **argv,
> if (field_type[0] == ';')
> field_type++;
> len = strlen(field_type) + 1;
> - if (array)
> + if (array) {
> len += strlen(array);
> + if (array[strlen(array) - 1] == ';')
> + len--;
> + }
Why not:
if (array) {
int l = strlen(array);
if (l && array[l - 1] == ';')
l--;
len += l;
}
-- Steve
Powered by blists - more mailing lists