On Thu, Oct 20, 2011 at 10:38 AM, Mark Wu <wu...@linux.vnet.ibm.com> wrote: > The "tracetool" script automates tedious trace event code generation and also > diff --git a/trace/simple.c b/trace/simple.c > index b639dda..869e315 100644 > --- a/trace/simple.c > +++ b/trace/simple.c > @@ -324,14 +324,29 @@ void trace_print_events(FILE *stream, fprintf_function > stream_printf) > bool trace_event_set_state(const char *name, bool state) > { > unsigned int i; > - > + unsigned int len; > + bool wildcard = false; > + bool matched = false; > + > + len = strlen(name); > + if (name[len-1] == '*') {
I think it's worth making a small change: if (len > 0 && name[len - 1] == '*') { Normally strlen(name) > 0 but just in case we should prevent accessing name[-1]. Seems fine otherwise. Perhaps we can figure out how to share code between simple.c and stderr.c in the future. Stefan