From e7e8cf1801b06a9f7f5092671b0413689a765fe7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 4 May 2026 18:02:57 +0200 Subject: cgit: use strchrnul instead of open coding Signed-off-by: Jason A. Donenfeld --- cgit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index 42beace..c33e6fc 100644 --- a/cgit.c +++ b/cgit.c @@ -789,9 +789,7 @@ static char *build_snapshot_setting(int bitmap) static char *get_first_line(char *txt) { char *t = xstrdup(txt); - char *p = strchr(t, '\n'); - if (p) - *p = '\0'; + *strchrnul(t, '\n') = '\0'; return t; } -- cgit v1.2.3