diff options
author | Brian C. Lane <bcl@redhat.com> | 2020-11-12 16:49:29 -0800 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2020-11-20 14:00:58 -0800 |
commit | 6e34cb98ddef0c9fd47359a2006265e7251e8830 (patch) | |
tree | b1fdaf6ecc231cc3d251900ef16289e11f1b593b /parted/ui.c | |
parent | 45e4c689c81cc55f849d3f90168a6b89c0168191 (diff) | |
download | parted-6e34cb98ddef0c9fd47359a2006265e7251e8830.tar.gz |
ui: Fix gcc 10 warning about snprintf truncating an int
Double the storage to 20 bytes.
Diffstat (limited to 'parted/ui.c')
-rw-r--r-- | parted/ui.c | 4 |
1 files 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) |