>From 020fb566fe9b858fff0eda04267bd143d9e05abe Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Wed, 29 Sep 2010 03:16:55 +0200
Subject: [PATCH] Silence a few warnings
Signed-off-by: Tamas TEVESZ <[email protected]>
---
WINGs/wapplication.c | 2 +-
WPrefs.app/Appearance.c | 8 ++++----
WPrefs.app/Menu.c | 2 +-
src/screen.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/WINGs/wapplication.c b/WINGs/wapplication.c
index b7e044d..070e0a9 100644
--- a/WINGs/wapplication.c
+++ b/WINGs/wapplication.c
@@ -74,7 +74,7 @@ static char *checkFile(char *path, char *folder, char *ext,
char *resource)
slen = strlen(path) + strlen(resource) + 1 + extralen;
ret = wmalloc(slen);
- if (strlcpy(ret, path, slen) >= slen)
+ if (wstrlcpy(ret, path, slen) >= slen)
goto error;
if (folder &&
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index faf3438..661972f 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -395,7 +395,7 @@ static void dumpRImage(char *path, RImage * image)
f = fopen(path, "wb");
if (!f) {
- werror(path);
+ werror("%s", path);
return;
}
fprintf(f, "%02x%02x%1x", image->width, image->height, channels);
@@ -404,7 +404,7 @@ static void dumpRImage(char *path, RImage * image)
fsync(fileno(f));
if (fclose(f) < 0) {
- werror(path);
+ werror("%s", path);
}
}
@@ -1572,7 +1572,7 @@ static void createPanel(Panel * p)
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
- werror(panel->fprefix);
+ werror("%s", panel->fprefix);
ok = False;
}
}
@@ -1582,7 +1582,7 @@ static void createPanel(Panel * p)
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
- werror(panel->fprefix);
+ werror("%s", panel->fprefix);
}
}
}
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index ef624ea..5c0aa3b 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -1646,7 +1646,7 @@ static WMPropList *processSubmenu(WEditMenu * menu)
pmenu = WMCreatePLArray(pl, NULL);
i = 0;
- while (item = WGetEditMenuItem(menu, i++)) {
+ while ((item = WGetEditMenuItem(menu, i++))) {
WEditMenu *submenu;
s = WGetEditMenuItemTitle(item);
diff --git a/src/screen.c b/src/screen.c
index 7966918..44bac8c 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -674,7 +674,7 @@ WScreen *wScreenInit(int screen_number)
scr->rcontext = RCreateContext(dpy, screen_number, &rattr);
if (!scr->rcontext && RErrorCode == RERR_STDCMAPFAIL) {
- wwarning(RMessageForError(RErrorCode));
+ wwarning("%s", RMessageForError(RErrorCode));
rattr.flags &= ~RC_StandardColormap;
rattr.standard_colormap_mode = RUseStdColormap;
--
1.7.0.4
--
[-]
mkdir /nonexistentFrom 020fb566fe9b858fff0eda04267bd143d9e05abe Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Wed, 29 Sep 2010 03:16:55 +0200
Subject: [PATCH] Silence a few warnings
Signed-off-by: Tamas TEVESZ <[email protected]>
---
WINGs/wapplication.c | 2 +-
WPrefs.app/Appearance.c | 8 ++++----
WPrefs.app/Menu.c | 2 +-
src/screen.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/WINGs/wapplication.c b/WINGs/wapplication.c
index b7e044d..070e0a9 100644
--- a/WINGs/wapplication.c
+++ b/WINGs/wapplication.c
@@ -74,7 +74,7 @@ static char *checkFile(char *path, char *folder, char *ext, char *resource)
slen = strlen(path) + strlen(resource) + 1 + extralen;
ret = wmalloc(slen);
- if (strlcpy(ret, path, slen) >= slen)
+ if (wstrlcpy(ret, path, slen) >= slen)
goto error;
if (folder &&
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index faf3438..661972f 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -395,7 +395,7 @@ static void dumpRImage(char *path, RImage * image)
f = fopen(path, "wb");
if (!f) {
- werror(path);
+ werror("%s", path);
return;
}
fprintf(f, "%02x%02x%1x", image->width, image->height, channels);
@@ -404,7 +404,7 @@ static void dumpRImage(char *path, RImage * image)
fsync(fileno(f));
if (fclose(f) < 0) {
- werror(path);
+ werror("%s", path);
}
}
@@ -1572,7 +1572,7 @@ static void createPanel(Panel * p)
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
- werror(panel->fprefix);
+ werror("%s", panel->fprefix);
ok = False;
}
}
@@ -1582,7 +1582,7 @@ static void createPanel(Panel * p)
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK) != 0) {
if (mkdir(panel->fprefix, 0755) < 0) {
- werror(panel->fprefix);
+ werror("%s", panel->fprefix);
}
}
}
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index ef624ea..5c0aa3b 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -1646,7 +1646,7 @@ static WMPropList *processSubmenu(WEditMenu * menu)
pmenu = WMCreatePLArray(pl, NULL);
i = 0;
- while (item = WGetEditMenuItem(menu, i++)) {
+ while ((item = WGetEditMenuItem(menu, i++))) {
WEditMenu *submenu;
s = WGetEditMenuItemTitle(item);
diff --git a/src/screen.c b/src/screen.c
index 7966918..44bac8c 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -674,7 +674,7 @@ WScreen *wScreenInit(int screen_number)
scr->rcontext = RCreateContext(dpy, screen_number, &rattr);
if (!scr->rcontext && RErrorCode == RERR_STDCMAPFAIL) {
- wwarning(RMessageForError(RErrorCode));
+ wwarning("%s", RMessageForError(RErrorCode));
rattr.flags &= ~RC_StandardColormap;
rattr.standard_colormap_mode = RUseStdColormap;
--
1.7.0.4