summaryrefslogtreecommitdiff
path: root/bits.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-11 00:53:46 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-11 00:53:46 -0400
commit6457da0570c5d99ee7164cdb38e3d32c87fe9d6d (patch)
tree4a7fd8dca9d94a65d6d5b82606de28e7556eec0e /bits.c
parent4fda87b5d4dc3dd8200e5f74d6fefc2a32616d6a (diff)
downloadgpsd-6457da0570c5d99ee7164cdb38e3d32c87fe9d6d.tar.gz
Fix a shift that was breaking sbits() on fields longer than 32 bits.
I'm not sure why 1 needed to be a long constant 1LL here - you'd think it would be 64 bits naturally on a 64-bit machine - but it did.
Diffstat (limited to 'bits.c')
-rw-r--r--bits.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bits.c b/bits.c
index 69b6c4af..96f051d4 100644
--- a/bits.c
+++ b/bits.c
@@ -73,7 +73,7 @@ int64_t sbits(char buf[], unsigned int start, unsigned int width)
(void)fprintf(stderr, "sbits(%d, %d) extracts %llx\n", start, width, fld);
#endif /* __UNUSED_DEBUG__ */
/*@ +relaxtypes */
- if (fld & (1 << (width - 1))) {
+ if (fld & (1LL << (width - 1))) {
#ifdef __UNUSED_DEBUG__
(void)fprintf(stderr, "%llx is signed\n", fld);
#endif /* __UNUSED_DEBUG__ */