Date: Wed, 27 Jan 2016 15:28:24 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294922 - head/lib/libdpv Message-ID: <201601271528.u0RFSONc093572@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dteske Date: Wed Jan 27 15:28:23 2016 New Revision: 294922 URL: https://svnweb.freebsd.org/changeset/base/294922 Log: 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> Modified: head/lib/libdpv/dialog_util.c Modified: head/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Wed Jan 27 15:19:48 2016 (r294921) +++ head/lib/libdpv/dialog_util.c Wed Jan 27 15:28:23 2016 (r294922) @@ -265,9 +265,9 @@ dialog_spawn_gauge(char *init_prompt, pi 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601271528.u0RFSONc093572>