]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/utf8: add missing assertion
authorMike Yuan <me@yhndnzj.com>
Tue, 18 Feb 2025 13:33:01 +0000 (14:33 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 21 Feb 2025 15:12:59 +0000 (16:12 +0100)
Follow-up for 104a6b8c390730f66f5acbcaefbc27898bfef9fe

src/basic/utf8.c

index 7b47df6f4f3e35ca00cac3ff4f275bcea9a674b6..633d86c6cf7f51b57cf626a8335b6e7ff41e5824 100644 (file)
@@ -613,6 +613,8 @@ size_t utf8_console_width(const char *str) {
 size_t utf8_last_length(const char *s, size_t n) {
         int r;
 
+        assert(s);
+
         if (n == SIZE_MAX)
                 n = strlen(s);