Skip to content

Commit

Permalink
Fix possible segfault if TERM variable not existent. (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
dl1jbe committed Oct 22, 2023
1 parent 657b6cc commit dfbbf60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ static void ui_init() {
/* getting users terminal string and (if RXVT) setting rxvt colours on it */
/* LZ3NY hack :) */
char *term = getenv("TERM");
if (term == NULL)
term = "";
if (strcasecmp(term, "rxvt") == 0 ||
strcasecmp(term, "rxvt-unicode") == 0) {
use_rxvt = true;
Expand Down

0 comments on commit dfbbf60

Please sign in to comment.