summaryrefslogtreecommitdiffstats
path: root/lib/libdpv
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2016-01-27 15:28:23 +0000
committerdteske <dteske@FreeBSD.org>2016-01-27 15:28:23 +0000
commitd2ce3b96899b55779d81ed942b224085cfc6f678 (patch)
treef9a5ad9fe8fbaef3773fc339b8ab324d284c1b4e /lib/libdpv
parent79f412ad44fac73a7ef6a1f14cfdf6864ae1bc09 (diff)
downloadFreeBSD-src-d2ce3b96899b55779d81ed942b224085cfc6f678.zip
FreeBSD-src-d2ce3b96899b55779d81ed942b224085cfc6f678.tar.gz
Fix fatal warn when compiling under GCC 5.2.0
GCC 5.2.0 generates the following [fatal] warning: dialog_util.c:270:23: error: zero-length gnu_printf format string [-Werror=format-zero-length] sprintf(dargv[n++], ""); Fix malloc argument while here, removing sprintf. Reported by: Ruslan Bukin <ruslan.bukin at cl cam ac uk>
Diffstat (limited to 'lib/libdpv')
-rw-r--r--lib/libdpv/dialog_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libdpv/dialog_util.c b/lib/libdpv/dialog_util.c
index 267d7a5..21baf98 100644
--- a/lib/libdpv/dialog_util.c
+++ b/lib/libdpv/dialog_util.c
@@ -265,9 +265,9 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid)
if ((dargv[n] = malloc(8)) == NULL)
errx(EXIT_FAILURE, "Out of memory?!");
sprintf(dargv[n++], "--title");
- if ((dargv[n] = malloc(8)) == NULL)
+ if ((dargv[n] = malloc(1)) == NULL)
errx(EXIT_FAILURE, "Out of memory?!");
- sprintf(dargv[n++], "");
+ *dargv[n++] = '\0';
}
if (backtitle != NULL) {
if ((dargv[n] = malloc(12)) == NULL)
OpenPOWER on IntegriCloud