Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cgit.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2026-05-04 19:02:57 +0300
committerJason A. Donenfeld <Jason@zx2c4.com>2026-05-04 19:28:27 +0300
commite7e8cf1801b06a9f7f5092671b0413689a765fe7 (patch)
treed052a194b3c9c2ff0f7dd37be44408a04bcdb114 /cgit.c
parent5b4e73c203f5f4484d66f043f1e9114daefeb632 (diff)
cgit: use strchrnul instead of open coding
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c4
1 files changed, 1 insertions, 3 deletions
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;
}