diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 106a306a..9107514d 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -544,7 +544,7 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int int style; RColor rcolor2; int i; - RImage *grad, *timage; + RImage *grad, *timage = NULL; char *path; switch (toupper(type[1])) { diff --git a/WPrefs.app/Paths.c b/WPrefs.app/Paths.c index ca1b353a..dcffd537 100644 --- a/WPrefs.app/Paths.c +++ b/WPrefs.app/Paths.c @@ -22,6 +22,7 @@ #include "WPrefs.h" #include +#include typedef struct _Panel { WMBox *box; @@ -131,6 +132,8 @@ static void browseForFile(WMWidget * w, void *data) _Panel *panel = (_Panel *) data; WMFilePanel *filePanel; + assert(w == panel->icoaB || w == panel->pixaB); + filePanel = WMGetOpenPanel(WMWidgetScreen(w)); WMSetFilePanelCanChooseFiles(filePanel, False); @@ -147,7 +150,7 @@ static void browseForFile(WMWidget * w, void *data) len--; } if (len > 0) { - WMList *lPtr; + WMList *lPtr = NULL; int i; if (w == panel->icoaB) diff --git a/src/misc.c b/src/misc.c index 7790edb9..b8810530 100644 --- a/src/misc.c +++ b/src/misc.c @@ -404,7 +404,7 @@ char *ShrinkString(WMFont * font, char *string, int width) char *FindImage(char *paths, char *file) { - char *tmp, *path; + char *tmp, *path = NULL; tmp = strrchr(file, ':'); if (tmp) { diff --git a/src/motif.c b/src/motif.c index 3e9e5e9e..c371e389 100644 --- a/src/motif.c +++ b/src/motif.c @@ -148,6 +148,7 @@ static int getMWMHints(Window window, MWMHints *mwmhints) if (!data) return 0; + mwmhints->flags = 0; if (count >= 4) { mwmhints->flags = data[0]; mwmhints->functions = data[1]; diff --git a/util/getstyle.c b/util/getstyle.c index 1023c10b..577554b1 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -181,7 +181,7 @@ static Bool isFontOption(char *option) /* XXX: is almost like WINGs/wcolodpanel.c:fetchFile() */ void copyFile(char *dir, char *file) { - FILE *src, *dst; + FILE *src = NULL, *dst = NULL; size_t nread, nwritten, len; char buf[4096]; struct stat st; @@ -230,7 +230,9 @@ void copyFile(char *dir, char *file) RETRY( fclose(dst) ) err: - RETRY( fclose(src) ) + if (src) { + RETRY( fclose(src) ) + } wfree(dstpath); return; } diff --git a/util/wmsetbg.c b/util/wmsetbg.c index cf4516fe..8f7638db 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -471,7 +471,7 @@ BackgroundTexture *parseTexture(RContext * rc, char *text) XColor color; Pixmap pixmap = None; RImage *image = NULL; - int iwidth, iheight; + int iwidth = 0, iheight = 0; RColor rcolor; GETSTRORGOTO(val, tmp, 1, error); @@ -879,7 +879,7 @@ void helperLoop(RContext * rc) memset(textures, 0, WORKSPACE_COUNT * sizeof(BackgroundTexture *)); while (1) { - int workspace; + int workspace = -1; /* get length of message */ if (readmsg(0, buffer, 4) < 0) {