pid1: terminate cylon string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 21 Nov 2023 21:54:18 +0000 (06:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 21 Nov 2023 23:49:25 +0000 (08:49 +0900)
Fixes #30121.

src/core/manager.c

index fcb7739..b4989e7 100644 (file)
@@ -214,8 +214,10 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
                 if (pos < width-1)
                         p = mempset(p, ' ', width-1-pos);
                 if (log_get_show_color())
-                        strcpy(p, ANSI_NORMAL);
+                        p = stpcpy(p, ANSI_NORMAL);
         }
+
+        *p = '\0';
 }
 
 static void manager_flip_auto_status(Manager *m, bool enable, const char *reason) {