aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/cli.c
diff options
context:
space:
mode:
authorSylvain Gault <sylvain.gault@gmail.com>2015-10-13 06:18:07 +0200
committerPaulo Alcantara <pcacjr@zytor.com>2015-10-18 12:56:32 -0300
commit8dc6d758b564a1ccc44c3ae11f265d43628219ce (patch)
treeced78bc1683aa2f117345b943d7f9b9955a3704c /com32/elflink/ldlinux/cli.c
parent9e0926bb338deb5c634ccb4ee29eb4577158cfdc (diff)
downloadsyslinux-8dc6d758b564a1ccc44c3ae11f265d43628219ce.tar.gz
syslinux-8dc6d758b564a1ccc44c3ae11f265d43628219ce.tar.xz
syslinux-8dc6d758b564a1ccc44c3ae11f265d43628219ce.zip
ldlinux: Fix return pointer to local data
The command-line parsing used to return a pointer to a local array. The code used to work by chance, but now, gcc 5 is able to detect it and return a NULL pointer instead. The buffer is now marked static. This shouldn't be a problem as only one command line can be read at a time. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Tested-by: poma <pomidorabelisima at gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Diffstat (limited to 'com32/elflink/ldlinux/cli.c')
-rw-r--r--com32/elflink/ldlinux/cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 6ff30c64..3119b11f 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -125,7 +125,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
int (*pDraw_Menu) (int, int, int),
void (*show_fkey) (int), bool *timedout)
{
- char cmdline[MAX_CMDLINE_LEN] = { };
+ static char cmdline[MAX_CMDLINE_LEN] = { };
int key, len, prev_len, cursor;
int redraw = 0;
int x, y;