> > Would it be better maybe to do the check in the Width() macro itself?
> 
> Yes indeed. New diff below.

> -#define Width(c)     wcwidth(c)
> +#define Width(c)     (wcwidth(c) == -1 ? 0 : wcwidth(c))

But this calls wcwidth() to be invoked twice, which is ugly. As a
minimum, make this an inline function.

Miod

Reply via email to