bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to handle negative bytes?


From: Thomas Dickey
Subject: Re: how to handle negative bytes?
Date: Fri, 22 Apr 2016 20:59:13 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Apr 22, 2016 at 03:52:52PM -0400, Anmol Sethi wrote:
> I’m writing a pure go terminfo library.  term(5) says "The value -1 is
> represented by the two bytes 0377, 0377; other negative values are illegal”. 
> So does this mean if I read any negative short integer that is not -1, should
> I throw an error?  Or should I just continue on?

I'd treat any other negative value as missing - by the time you're
processing those values, you should have checked that the string-heap
size is consistent, that the data is well-formatted.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]