[Geany-devel] txt2tags tagmanager patch

Nick Treleaven nick.treleaven at xxxxx
Mon Sep 7 11:49:23 UTC 2009


On Sun, 6 Sep 2009 22:57:24 +0200
Enrico Tröger <enrico.troeger at uvena.de> wrote:

> One question:
> in txt2tags,c line 89, there is a check
> ... if (line[0] == '°') ...
> 
> which doesn't make much sense as you check line[0] which is one byte
> long (8bit) but the character you want to check is a multi-byte
> character, in this case it is 2 bytes long. So, the check can never
> work really. As I don't know txt2tags, I wonder whether the character
> to test for is just a typo or whether the code should be adjusted to
> properly check for a multi-byte character (e.g. with strncmp()).
> 
> So far I committed it, but it needs to be fixed. It also causes an
> appropriate compiler warnings.

For now I changed it to use strcmp to avoid the warnings.

Regards,
Nick



More information about the Devel mailing list