fix(console): Default read_func to the read function

To make sure the static function pointer read_func is never NUL,
set its default value to th read function instead of setting it
to NULL pointer.
This commit is contained in:
Guillaume Souchere
2025-04-08 08:49:40 +02:00
parent 6b4f08c1dc
commit bd7814c93a

View File

@ -238,7 +238,7 @@ static void flushWrite(void) {
fsync(fileno(stdout));
}
static linenoise_read_bytes_fn read_func = NULL;
static linenoise_read_bytes_fn read_func = read;
void linenoiseSetReadFunction(linenoise_read_bytes_fn read_fn)
{
read_func = read_fn;