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: owner-openssl-...@openssl.org [mailto:owner-openssl-...@openssl.org] On
Behalf Of Michel
Sent: Thursday, August 22, 2013 11:44 AM
To: openssl-dev@openssl.org
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                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to