> @@ -48,6 +48,14 @@ sigwinch(int sig)
>  static void
>  exit_handler(void)
>  {
> +     char *title = getenv("TERM");
> +
> +     /* reset terminal's window name */
> +     if (strncmp(title, "screen", 6) == 0)
> +             printf("\033k%s\033\\", title);

I'd personally test for NULL before passing it to strncmp() just in
case.

> -     if (strcmp(getenv("TERM"), "screen") == 0)
> +     if (strncmp(getenv("TERM"), "screen", 6) == 0)
>               printf("\033k%s\033\\", title);

Same here.

- NRK

Reply via email to