| -rw-r--r-- | cgit.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -789,7 +789,9 @@ static char *build_snapshot_setting(int bitmap) static char *get_first_line(char *txt) { char *t = xstrdup(txt); - *strchrnul(t, '\n') = '\0'; + char *p = strchr(t, '\n'); + if (p) + *p = '\0'; return t; } |