Unverified Commit 32924c21 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel Committed by GitHub
Browse files

Merge pull request #531 from Ferada/fix-some-warnings

Fix some warnings from `gcc`.
parents 61d17588 a2357149
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -197,7 +197,10 @@ int feh_png_file_is_png(FILE * fp)
{
	unsigned char buf[8];

	fread(buf, 1, 8, fp);
	if (fread(buf, 1, 8, fp) != 8) {
		return 0;
	}

	if (png_sig_cmp(buf, 0, 8)) {
		return 0;
	}
+3 −2
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ void feh_file_dirname(char *dst, feh_file * f, int maxlen)
		return;
	}

	strncpy(dst, f->filename, n);
	memcpy(dst, f->filename, n);
	dst[n] = '\0';
}

@@ -650,7 +650,8 @@ char *feh_absolute_path(char *path)
	   path you give it is relative. Linux and BSD get this right... */
	if (getcwd(cwd, sizeof(cwd)) == NULL)
		eprintf("Cannot determine working directory:");
	snprintf(temp, sizeof(temp), "%s/%s", cwd, path);
	if ((size_t) snprintf(temp, sizeof(temp), "%s/%s", cwd, path) >= sizeof(temp))
		eprintf("Absolute path for working directory was truncated");
	if (realpath(temp, fullpath) != NULL) {
		ret = estrdup(fullpath);
	} else {
+1 −3
Original line number Diff line number Diff line
@@ -637,9 +637,7 @@ static char *feh_dcraw_load_image(char *filename)
		close(fd);
		return NULL;
	} else if (childpid == 0) {

		close(1);
		dup(fd);
		dup2(fd, STDOUT_FILENO);
		close(fd);

		alarm(opt.conversion_timeout);
+2 −1
Original line number Diff line number Diff line
@@ -385,7 +385,8 @@ void feh_action_run(feh_file * file, char *action, winwidget winwid)

		if (opt.verbose && !opt.list && !opt.customlist)
			fprintf(stderr, "Running action -->%s<--\n", sys);
		system(sys);
		if (system(sys) == -1)
			perror("running action via system() failed");
	}
	return;
}
+4 −1
Original line number Diff line number Diff line
@@ -382,7 +382,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) {