From a385c39c2efb249b8d772d42c77fe8e85a62fcf5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 8 Jun 2022 14:59:47 +0530 Subject: [PATCH] Fix reading of dead prewarmed child pids --- kitty/child-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index e45d5f126..3b3952b8c 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -1319,7 +1319,7 @@ reap_prewarmed_children(ChildMonitor *self, int fd, bool enable_close_on_child_d buf_pos += len; char *nl; while (buf_pos > 1 && (nl = memchr(buf, '\n', buf_pos)) != NULL) { - size_t sz = nl - buf; + size_t sz = nl - buf + 1; if (enable_close_on_child_death) { *nl = 0; int pid = atoi(buf);