On Fri, Feb 14, 2014 at 12:58:32AM +0100, Egbert Eich wrote: > On Fri, Feb 14, 2014 at 07:52:02AM +1000, Peter Hutterer wrote: > > On Wed, Feb 12, 2014 at 08:00:27PM +0100, Egbert Eich wrote: > > > From: Egbert Eich <e...@suse.com> > > > > > > Signed-off-by: Egbert Eich <e...@suse.com> > > > --- > > > src/xf86WacomDefs.h | 2 +- > > > test/wacom-tests.c | 2 +- > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h > > > index 3a64fd6..6de9645 100644 > > > --- a/src/xf86WacomDefs.h > > > +++ b/src/xf86WacomDefs.h > > > @@ -515,7 +515,7 @@ struct _WacomTool > > > int typeid; /* Tool type */ > > > unsigned int serial; /* Serial id, 0 == no serial id */ > > > Bool enabled; > > > - char *name; > > > + char const *name; > > > > > > InputInfoPtr device; /* The InputDevice connected to this tool */ > > > }; > > > diff --git a/test/wacom-tests.c b/test/wacom-tests.c > > > index 75f32b6..743bd2c 100644 > > > --- a/test/wacom-tests.c > > > +++ b/test/wacom-tests.c > > > @@ -185,7 +185,7 @@ test_normalize_pressure(void) > > > > > > priv.common = &common; > > > priv.pInfo = &pInfo; > > > - pInfo.name = "Wacom test device"; > > > + pInfo.name = strdupa("Wacom test device"); > > > > hmm, if you're using strdupa anyway you dont need the char const* anymore? > > > > No, these were two separate issues: (InputInfoPtr)->name is (char *) > not (char const *) thus we need the strdupa() while the change for name > in WacomTool is required because of: > else ser->name = ""; /*no name yet*/ > in wcmValidateDevice.c - ie. the opposite issue.
oh, right. I'm happy with the second bit then, but the first one should be fixed by strdup'ing the temporary name. Looks like we currently leak the name anyway, wcmFreeCommon doesn't release it and the name is strdup'd if there is a proper one. So I think we should strdup() it here too, and you get bonus points for fixing the leak in a separate patch ;) Cheers, Peter ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel