Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sylvain Gault authored and Paulo Alcantara committed Oct 18, 2015
1 parent 9e0926b commit 8dc6d75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion com32/elflink/ldlinux/cli.c
Expand Up @@ -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;
Expand Down

0 comments on commit 8dc6d75

Please sign in to comment.