Re: [hackers] [lchat] minor cleanup and adjustments || Tom Schwindl

From: NRK <nrk_AT_disroot.org>
Date: Sun, 9 Oct 2022 11:42:58 +0600

> _AT_@ -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
Received on Sun Oct 09 2022 - 07:42:58 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 09 2022 - 07:48:35 CEST