Re: [hackers] [PATCH v3][sbase] libutil/unescape.c: simplify and add \E

2017-02-06 Thread Mattias Andrée
On Mon, 06 Feb 2017 15:50:04 -0800 evan.ga...@gmail.com (Evan Gates) wrote: > Mattias Andrée wrote: > > > On Mon, 06 Feb 2017 15:05:32 -0800 > > evan.ga...@gmail.com (Evan Gates) wrote: > > > > > Mattias Andrée wrote: > > > > > > > + } else if (escapes[*r & 255]) { > > > > +

Re: Re: [hackers] [PATCH v3][sbase] libutil/unescape.c: simplify and add \E

2017-02-06 Thread Evan Gates
Mattias Andrée wrote: > On Mon, 06 Feb 2017 15:05:32 -0800 > evan.ga...@gmail.com (Evan Gates) wrote: > > > Mattias Andrée wrote: > > > > > + } else if (escapes[*r & 255]) { > > > + *w++ = escapes[*r++ & 255]; > > > > Why do you & 255 here? I think a cast to unsigned

Re: [hackers] [PATCH v3][sbase] libutil/unescape.c: simplify and add \E

2017-02-06 Thread Mattias Andrée
On Mon, 06 Feb 2017 15:05:32 -0800 evan.ga...@gmail.com (Evan Gates) wrote: > Mattias Andrée wrote: > > > + } else if (escapes[*r & 255]) { > > + *w++ = escapes[*r++ & 255]; > > Why do you & 255 here? I think a cast to unsigned char > would accomplish what you are

Re: [hackers] [PATCH v3][sbase] libutil/unescape.c: simplify and add \E

2017-02-06 Thread Evan Gates
Mattias Andrée wrote: > + } else if (escapes[*r & 255]) { > + *w++ = escapes[*r++ & 255]; Why do you & 255 here? I think a cast to unsigned char would accomplish what you are trying to do and be more correct (as char can default to either signed or unsigned). Alth