From aa4249940da2719428257ab00c287244662be540 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sun, 28 Sep 2025 22:45:20 -0700 Subject: [PATCH] fixed nxplayer buffer length definition --- system/nxplayer/nxplayer_main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index dc9d60152..77ab4a923 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -48,6 +48,17 @@ # define NXPLAYER_HELP_TEXT(x) #endif +/* Size of the command input buffer. Prefer the NSH line length when the + * shell is enabled so behaviour matches other readline users, otherwise + * fall back to a modest default. + */ + +#ifdef CONFIG_NSH_LINELEN +# define NXPLAYER_LINELEN CONFIG_NSH_LINELEN +#else +# define NXPLAYER_LINELEN 80 +#endif + /**************************************************************************** * Private Type Declarations ****************************************************************************/ @@ -737,7 +748,7 @@ static int nxplayer_cmd_help(FAR struct nxplayer_s *pplayer, char *parg) int main(int argc, FAR char *argv[]) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[NXPLAYER_LINELEN]; int len; int x; int running;