summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-04-12 23:02:10 +0300
committerToomas Soome <tsoome@me.com>2020-09-08 08:41:10 +0300
commit7aaede4825001926ae223b8c47ef9e4d0d6021ba (patch)
treefae88b23c1c6e5f9294a9361bf8c476d6b9a1117 /usr/src/lib
parent712669c9fa9278704a4ccefe1d96acaf29397d36 (diff)
downloadillumos-joyent-7aaede4825001926ae223b8c47ef9e4d0d6021ba.tar.gz
12974 libc: left shift of negative value
Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Gary Mills <gary_mills@fastmail.fm> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libc/port/gen/_ftoll.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr/src/lib/libc/port/gen/_ftoll.c b/usr/src/lib/libc/port/gen/_ftoll.c
index 857a52b8a1..66d71f566c 100644
--- a/usr/src/lib/libc/port/gen/_ftoll.c
+++ b/usr/src/lib/libc/port/gen/_ftoll.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "lint.h"
#include <sys/isa_defs.h>
#include <floatingpoint.h>
@@ -104,7 +102,7 @@ __dtoll(double dval)
default:
if (exp > 30) {
m1 = (m0 << (exp - 30)) |
- (m1 >> (62 - exp)) & ~(-1 << (exp - 30));
+ (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30));
m0 >>= 62 - exp;
} else {
m1 = m0 >> (30 - exp);
@@ -275,7 +273,7 @@ _Q_qtoll(long double longdbl)
default:
if (exp > 30) {
m1 = (m0 << (exp - 30)) |
- (m1 >> (62 - exp)) & ~(-1 << (exp - 30));
+ (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30));
m0 >>= 62 - exp;
} else {
m1 = m0 >> (30 - exp);