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>
This commit is contained in:
parent
79f412ad44
commit
d2ce3b9689
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user