Skip to content

Commit

Permalink
clip: remove trailing \0
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Aug 31, 2024
1 parent 248d344 commit 733b5c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -4022,7 +4022,10 @@ static void perform_ver(const char *arg)

static void cl_write(const char *buf, int len)
{
write(STDOUT_FILENO, buf, len);
if (len && buf[len - 1] == '\0')
len--;
if (len)
write(STDOUT_FILENO, buf, len);
}

static void perform_clip(const char *arg)
Expand Down

0 comments on commit 733b5c1

Please sign in to comment.