* Alexandre Montplaisir ([email protected]) wrote: > On 11-01-25 07:59 PM, Mathieu Desnoyers wrote: > > * Alexandre Montplaisir ([email protected]) wrote: > >> Add and check the return values of fscanf, fread and asprintf functions. > >> > >> That should be it! GCC 4.5 with -Wall doesn't report anything else. > >> > >> Signed-off-by: Alexandre Montplaisir <[email protected]> > >> --- > >> lttv/lttv/attribute.c | 8 ++-- > >> lttv/lttv/state.c | 72 > >> ++++++++++++++++++++++++--------------- > >> lttv/modules/text/depanalysis.c | 23 +++++++++---- > >> 3 files changed, 64 insertions(+), 39 deletions(-) > >> > >> diff --git a/lttv/lttv/attribute.c b/lttv/lttv/attribute.c > >> index 243fe02..3b09468 100644 > >> --- a/lttv/lttv/attribute.c > >> +++ b/lttv/lttv/attribute.c > >> @@ -487,13 +487,13 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE > >> *fp) > >> > >> LttvAttribute *subtree; > >> > >> - fscanf(fp,"<ATTRS>"); > >> + res = fscanf(fp, "<ATTRS>"); > > Is it me or you forgot to check res here ? > > Yeah, I omitted it on purpose, since we're feeding it a literal anyway. > The "res =", albeit useless, suppresses the warning. > Would you rather have it check for res > 0 ?
Yep, please, Mathieu > > -- > Alexandre Montplaisir > DORSAL lab, > École Polytechnique de Montréal > -- Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com _______________________________________________ ltt-dev mailing list [email protected] http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
