mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix #290: terminate g_buf correctly
This commit is contained in:
parent
a9392463b0
commit
4d6f304204
|
@ -1887,7 +1887,11 @@ END:
|
||||||
clearprompt();
|
clearprompt();
|
||||||
|
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
wcstombs(g_buf, buf, CMD_LEN_MAX);
|
|
||||||
|
pos = wcstombs(g_buf, buf, CMD_LEN_MAX - 1);
|
||||||
|
if (pos >= CMD_LEN_MAX - 1)
|
||||||
|
g_buf[CMD_LEN_MAX - 1] = '\0';
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return g_buf;
|
return g_buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue