summaryrefslogtreecommitdiff
path: root/src/wallpaper.c
diff options
context:
space:
mode:
authorOlof-Joachim Frahm <olof@shiftleft.io>2020-05-29 11:41:58 +0200
committerOlof-Joachim Frahm <olof@shiftleft.io>2020-05-29 11:41:58 +0200
commita23571495beb95e146755e16b1a02dff03624625 (patch)
treee373c1e1e68539407a076003f8b92254941cce17 /src/wallpaper.c
parentc9e024daeb43094696a05c8d03ef6682ed683dae (diff)
Fix some warnings from `gcc`.
Diffstat (limited to 'src/wallpaper.c')
-rw-r--r--src/wallpaper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallpaper.c b/src/wallpaper.c
index 37b5a1d..62b36a4 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -282,7 +282,10 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
feh_wm_load_next(&im);
fil = FEH_FILE(filelist->data)->filename;
}
- snprintf(sendbuf, sizeof(sendbuf), "background %s bg.file %s", bgname, fil);
+ if ((size_t) snprintf(sendbuf, sizeof(sendbuf), "background %s bg.file %s", bgname, fil) >= sizeof(sendbuf)) {
+ weprintf("Writing to IPC send buffer was truncated");
+ return;
+ }
enl_ipc_send(sendbuf);
if (scaled) {