Re: [dev] [st][PATCH] unsigned function tdefcolor returns -1 on error

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 5 Aug 2013 08:18:38 +0200

On Sun, Aug 04, 2013 at 08:54:35AM -0400, Eon S. Jeon wrote:
> Hi
>
> I found that tdefcolor returns -1 on error, while its return type is
> unsigned long. At the same time, line 1724 and 1731 are checking the
> positivity of its unsigned return value.
>
> _AT_@ -1721,14 +1721,14 @@ tsetattr(int *attr, int l) {
> term.c.attr.mode &= ~ATTR_REVERSE;
> break;
> case 38:
> - if ((idx = tdefcolor(attr, &i, l)) >= 0)
> + if ((long)(idx = tdefcolor(attr, &i, l)) >= 0)

Good point, but I think is better change the type of tdefcolor instead.
Could you amend the patch and send it again?


-- 
Roberto E. Vargas Caballero
----------------------------
k0ga_AT_shike2.com
http://www.shike2.com
Received on Mon Aug 05 2013 - 08:18:38 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 05 2013 - 08:24:06 CEST