parted/0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch
DistroBaker b7125dc640 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/parted.git#633c371306f0da38c70879e948b612775032740a
2020-12-01 18:08:09 +00:00

32 lines
954 B
Diff

From 6e34cb98ddef0c9fd47359a2006265e7251e8830 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 12 Nov 2020 16:49:29 -0800
Subject: [PATCH 36/42] ui: Fix gcc 10 warning about snprintf truncating an int
Double the storage to 20 bytes.
---
parted/ui.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parted/ui.c b/parted/ui.c
index 8e1f2fe..73fdcf5 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -909,11 +909,11 @@ command_line_get_word (const char* prompt, const char* def,
int
command_line_get_integer (const char* prompt, int* value)
{
- char def_str [10];
+ char def_str [20];
char* input;
long ret;
- snprintf (def_str, 10, "%d", *value);
+ snprintf (def_str, 20, "%d", *value);
input = command_line_get_word (prompt, *value ? def_str : NULL,
NULL, 1);
if (!input)
--
2.26.2