x509asn1: suppress left shift on signed value
Use an unsigned variable: as the signed operation behavior is undefined, this change silents clang-tidy about it. Ref: https://github.com/curl/curl/pull/3163 Reported-By: Daniel Stenberg
This commit is contained in:
Родитель
3793761a37
Коммит
c335b7f1f7
|
@ -223,7 +223,7 @@ static const char *bit2str(const char *beg, const char *end)
|
|||
|
||||
static const char *int2str(const char *beg, const char *end)
|
||||
{
|
||||
long val = 0;
|
||||
unsigned long val = 0;
|
||||
size_t n = end - beg;
|
||||
|
||||
/* Convert an ASN.1 integer value into its string representation.
|
||||
|
@ -243,7 +243,7 @@ static const char *int2str(const char *beg, const char *end)
|
|||
do
|
||||
val = (val << 8) | *(const unsigned char *) beg++;
|
||||
while(beg < end);
|
||||
return curl_maprintf("%s%lx", (val < 0 || val >= 10)? "0x": "", val);
|
||||
return curl_maprintf("%s%lx", val >= 10? "0x": "", val);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
Загрузка…
Ссылка в новой задаче