wmalloc is already taking care of the memory allocation return value, and i replace strcpy to strncpy
--- src/dialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index da126ae..d0d9179 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -899,7 +899,7 @@ static void keyPressHandler(XEvent * event, void *data) Bool wIconChooserDialog(WScreen *scr, char **file, const char *instance, const char *class) { - WWindow *wwin; + WWindow *wwin = NULL; Window parent; IconPanel *panel; WMColor *color; @@ -1018,10 +1018,10 @@ Bool wIconChooserDialog(WScreen *scr, char **file, const char *instance, const c tmp = wmalloc(len); - if (tmp && (instance || class)) + if (instance || class) snprintf(tmp, len, "%s [%s.%s]", _("Icon Chooser"), instance, class); else - strcpy(tmp, _("Icon Chooser")); + strncpy(tmp, _("Icon Chooser"), len); center = getCenter(scr, 450, 280); -- 1.8.3.2
0003-wmalloc-is-already-taking-care-of-the-memory-allocat.patch
Description: Binary data