[Top][All Lists]

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

Re: how to handle negative bytes?

From: Anmol Sethi
Subject: Re: how to handle negative bytes?
Date: Fri, 22 Apr 2016 22:08:00 -0400

What exactly do you mean by I should have checked the string-heap size is 
consistent and the data is well formatted?

> On Apr 22, 2016, at 8:59 PM, Thomas Dickey <address@hidden> wrote:
> 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

reply via email to

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