mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix illegal access
This commit is contained in:
parent
83fa6a0ff6
commit
d5e303beb7
11
src/nnn.c
11
src/nnn.c
|
@ -1594,6 +1594,8 @@ static bool initcurses(void *oldmask)
|
||||||
use_default_colors();
|
use_default_colors();
|
||||||
|
|
||||||
if (colors && *colors == '#') {
|
if (colors && *colors == '#') {
|
||||||
|
char *sep = strchr(colors, ';');
|
||||||
|
|
||||||
if (COLORS >= 256) {
|
if (COLORS >= 256) {
|
||||||
++colors;
|
++colors;
|
||||||
ext = TRUE;
|
ext = TRUE;
|
||||||
|
@ -1603,12 +1605,13 @@ static bool initcurses(void *oldmask)
|
||||||
* to NULL so we don't interpret separator and fallback
|
* to NULL so we don't interpret separator and fallback
|
||||||
* if fewer than CTX_MAX xterm 256 colors are specified.
|
* if fewer than CTX_MAX xterm 256 colors are specified.
|
||||||
*/
|
*/
|
||||||
char *sep = strchr(colors, ';');
|
|
||||||
if (sep)
|
if (sep)
|
||||||
*sep = '\0';
|
*sep = '\0';
|
||||||
} else
|
} else {
|
||||||
/* Check if 8 colors fallback is appended */
|
colors = sep; /* Detect if 8 colors fallback is appended */
|
||||||
colors = strchr(colors, ';') + 1;
|
if (colors)
|
||||||
|
++colors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get and set the context colors */
|
/* Get and set the context colors */
|
||||||
|
|
Loading…
Reference in a new issue