If your intention is performance optimization you could even replace

  if((*p & 0x80) == 0)

with

  if((signed char)(*p) >= 0)

as you cannot assume that all compilers will do it correctly themselves.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Michel
Sent: Thursday, August 22, 2013 11:44 AM
To: [email protected]
Subject: UTF8 decoding, unneeded byte masking

In a_utf8.c, lines 85 and 86 (1.0.1e) :

...
  if((*p & 0x80) == 0) {                 //  as this byte looks like : 
0xxxxxxx
         value = *p++ & 0x7f;          //  this line could as well be 
written : value = *p++;
...

If I don't  miss something, it would seems clearer to me.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to