Re: [PATCH] mailinfo: support Unicode scissors
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Mar 31, 2019, 23:09 UTC
- Message-ID
- <20190331230947.GI32732@szeder.dev>
- In-Reply-To
- <20190331220104.31628-1-rybak.a.v@gmail.com>
On Mon, Apr 01, 2019 at 12:01:04AM +0200, Andrei Rybak wrote:
Show 9 quoted lines
> diff --git a/mailinfo.c b/mailinfo.c
> index b395adbdf2..4ef6cdee85 100644
> --- a/mailinfo.c
> +++ b/mailinfo.c
> @@ -701,6 +701,13 @@ static int is_scissors_line(const char *line)
> c++;
> continue;
> }
> + if (!memcmp(c, "✂", 3)) {This character is tiny. Please add a comment that it's supposed to be a Unicode scissors character.
Should we worry about this memcmp() potentially reading past the end of the string when 'c' points to the last character?
> + in_perforation = 1; > + perforation += 3; > + scissors += 3; > + c++;
Here you should jump past the three byte long Unicode character, so this should be c += 2.
Show 5 quoted lines
> + continue; > + } > in_perforation = 0; > } >