From: Christophe CURIS <[email protected]> This patch is used to catch some return function value to avoid possible misbehaviour, as reported by the compiler.
- use of proper type for fread's ssize comparison - include command name in error message to help user understand what's going on Signed-off-by: Christophe CURIS <[email protected]> --- WPrefs.app/Appearance.c | 5 +++-- WPrefs.app/MouseSettings.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 500cbdd..ec71ee4 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -1262,6 +1262,7 @@ static Pixmap loadRImage(WMScreen * scr, const char *path) FILE *f; RImage *image; int w, h, d, cnt; + size_t read_size; Pixmap pixmap; f = fopen(path, "rb"); @@ -1274,8 +1275,8 @@ static Pixmap loadRImage(WMScreen * scr, const char *path) return None; } image = RCreateImage(w, h, d == 4); - cnt = w * h * d; - if (fread(image->data, 1, cnt, f) != cnt) { + read_size = w * h * d; + if (fread(image->data, 1, read_size, f) != read_size) { fclose(f); return None; } diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index f83ec3a..31d467d 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -715,7 +715,8 @@ static void storeCommandInScript(const char *cmd, const char *line) } sprintf(buffer, "chmod u+x %s", path); if (system(buffer) == -1) - werror(_("could not execute command")); + werror(_("could not execute command \"%s\""), buffer); + end: wfree(path); if (f) { -- 1.9.1 -- To unsubscribe, send mail to [email protected].
