diff options
author | Andy Polyakov <appro@openssl.org> | 2012-12-01 19:24:20 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2012-12-01 19:24:20 +0100 |
commit | f91926a2409e96ffe8eb6f6233aaeb6c6a213112 (patch) | |
tree | 5d3fd62111321ddeee7c9baf1783281934035aad /crypto/cryptlib.c | |
parent | aesni-x86_64.pl: CTR face lift, +25% on Bulldozer. (diff) | |
download | openssl-f91926a2409e96ffe8eb6f6233aaeb6c6a213112.tar.xz openssl-f91926a2409e96ffe8eb6f6233aaeb6c6a213112.zip |
cryptlib.c: fix logical error.
Diffstat (limited to 'crypto/cryptlib.c')
-rw-r--r-- | crypto/cryptlib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 28bc254fab..14453491de 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -152,13 +152,16 @@ void OPENSSL_cpuid_setup(void) if (!sscanf(env+off,"%lli",(long long *)&vec)) vec = strtoul(env+off,NULL,0); #endif if (off) vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P)&~vec; + else if (env[0]==':') vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P); OPENSSL_ia32cap_P[2] = 0; if ((env=strchr(env,':'))) { - off = (env[1]=='~')?2:1; - vec = strtoul(env+off,NULL,0); - if (off>1) OPENSSL_ia32cap_P[2] &= ~vec; - else OPENSSL_ia32cap_P[2] = vec; + unsigned int vecx; + env++; + off = (env[0]=='~')?1:0; + vecx = strtoul(env+off,NULL,0); + if (off) OPENSSL_ia32cap_P[2] &= ~vecx; + else OPENSSL_ia32cap_P[2] = vecx; } } else |