Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix warnings reported by clang
Baptiste Daroussin committed 9 years ago
commit 1d317c386f295f7b5e4cb5b3efe4eccb8295b28e
parent d2fd4b0
8 files changed +17 -16
modified libpkg/fetch.c
@@ -376,7 +376,7 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
				utstring_printf(cmd, "-p %d ", u->port);
			if (u->user[0] != '\0')
				utstring_printf(cmd, "%s@", u->user);
-
			utstring_printf(cmd, u->host);
+
			utstring_printf(cmd, "%s", u->host);
			utstring_printf(cmd, " pkg ssh");
			pkg_debug(1, "Fetch: running '%s'", utstring_body(cmd));
			argv[0] = _PATH_BSHELL;
modified libpkg/pkg_printf.c
@@ -2875,7 +2875,7 @@ pkg_vprintf(const char * restrict format, va_list ap)

	if (buf)
		buf = pkg_utstring_vprintf(buf, format, ap);
-
	if (buf && utstring_len(buf) >= 0) {
+
	if (buf && utstring_len(buf) > 0) {
		count = printf("%s", utstring_body(buf));
	} else
		count = -1;
@@ -2919,7 +2919,7 @@ pkg_vfprintf(FILE * restrict stream, const char * restrict format, va_list ap)

	if (buf)
		buf = pkg_utstring_vprintf(buf, format, ap);
-
	if (buf && utstring_len(buf) >= 0) {
+
	if (buf && utstring_len(buf) > 0) {
		count = fprintf(stream, "%s", utstring_body(buf));
	} else
		count = -1;
@@ -2967,7 +2967,7 @@ pkg_vdprintf(int fd, const char * restrict format, va_list ap)

	if (buf)
		buf = pkg_utstring_vprintf(buf, format, ap);
-
	if (buf && utstring_len(buf) >= 0) {
+
	if (buf && utstring_len(buf) > 0) {
		count = dprintf(fd, "%s", utstring_body(buf));
	} else 
		count = -1;
@@ -3020,7 +3020,7 @@ pkg_vsnprintf(char * restrict str, size_t size, const char * restrict format,

	if (buf)
		buf = pkg_utstring_vprintf(buf, format, ap);
-
	if (buf && utstring_len(buf) >= 0) {
+
	if (buf && utstring_len(buf) > 0) {
		count = snprintf(str, size, "%s", utstring_body(buf));
	} else
		count = -1;
@@ -3071,7 +3071,7 @@ pkg_vasprintf(char **ret, const char * restrict format, va_list ap)

	if (buf)
		buf = pkg_utstring_vprintf(buf, format, ap);
-
	if (buf && utstring_len(buf) >= 0) {
+
	if (buf && utstring_len(buf) > 0) {
		count = asprintf(ret, "%s", utstring_body(buf));
	} else {
		count = -1;
modified libpkg/plugins.c
@@ -155,7 +155,7 @@ pkg_plugin_set(struct pkg_plugin *p, pkg_plugin_key key, const char *str)
	assert(p != NULL);

	utstring_renew(p->fields[key]);
-
	utstring_printf(p->fields[key], str);
+
	utstring_printf(p->fields[key], "%s", str);
	return (EPKG_OK);
}

modified libpkg/utils.c
@@ -211,7 +211,7 @@ format_exec_cmd(char **dest, const char *in, const char *prefix,
				utstring_free(buf);
				return (EPKG_FATAL);
			}
-
			utstring_printf(buf, plist_file);
+
			utstring_printf(buf, "%s", plist_file);
			break;
		case 'f':
			if (plist_file == NULL || plist_file[0] == '\0') {
@@ -228,7 +228,7 @@ format_exec_cmd(char **dest, const char *in, const char *prefix,
				    prefix, plist_file);
			cp = strrchr(path, '/');
			cp ++;
-
			utstring_printf(buf, cp);
+
			utstring_printf(buf, "%s", cp);
			break;
		case 'B':
			if (plist_file == NULL || plist_file[0] == '\0') {
@@ -245,14 +245,14 @@ format_exec_cmd(char **dest, const char *in, const char *prefix,
				    plist_file);
			cp = strrchr(path, '/');
			cp[0] = '\0';
-
			utstring_printf(buf, path);
+
			utstring_printf(buf, "%s", path);
			break;
		case '%':
			utstring_printf(buf, "%c", '%');
			break;
		case '@':
			if (line != NULL) {
-
				utstring_printf(buf, line);
+
				utstring_printf(buf, "%s", line);
				break;
			}

@@ -274,7 +274,7 @@ format_exec_cmd(char **dest, const char *in, const char *prefix,
					utstring_free(buf);
					return (EPKG_FATAL);
				}
-
				utstring_printf(buf, argv[pos -1]);
+
				utstring_printf(buf, "%s", argv[pos -1]);
				in += sz -1;
				break;
			}
modified src/add.c
@@ -164,7 +164,7 @@ exec_add(int argc, char **argv)
				warn("%s", file);
				if (errno == ENOENT)
					warnx("Was 'pkg install %s' meant?", file);
-
				utstring_printf(failedpkgs, argv[i]);
+
				utstring_printf(failedpkgs, "%s", argv[i]);
				if (i != argc - 1)
					utstring_printf(failedpkgs, ", ");
				failedpkgcount++;
@@ -174,7 +174,7 @@ exec_add(int argc, char **argv)
		}

		if ((retcode = pkg_add(db, file, f, keys, location)) != EPKG_OK) {
-
			utstring_printf(failedpkgs, argv[i]);
+
			utstring_printf(failedpkgs, "%s", argv[i]);
			if (i != argc - 1)
				utstring_printf(failedpkgs, ", ");
			failedpkgcount++;
modified src/audit.c
@@ -100,7 +100,7 @@ print_recursive_rdeps(kh_pkgs_t *head, struct pkg *p, UT_string *sb,
				if (!top)
					utstring_printf(sb, ", ");

-
				utstring_printf(sb, name);
+
				utstring_printf(sb, "%s", name);

				print_recursive_rdeps(head, kh_val(head, h), sb, seen, false);

modified src/check.c
@@ -40,6 +40,7 @@
#include <string.h>
#include <unistd.h>
#include <utlist.h>
+
#include <utstring.h>

#include <pkg.h>

modified src/event.c
@@ -884,7 +884,7 @@ event_callback(void *data, struct pkg_event *ev)
	case PKG_EVENT_MESSAGE:
		if (messages == NULL)
			utstring_new(messages);
-
		utstring_printf(messages, ev->e_pkg_message.msg);
+
		utstring_printf(messages, "%s", ev->e_pkg_message.msg);
		break;
	case PKG_EVENT_CLEANUP_CALLBACK_REGISTER:
		if (!signal_handler_installed) {