summaryrefslogtreecommitdiff
path: root/bits.c
diff options
context:
space:
mode:
authorIgor Socec <isocec@gmail.com>2013-09-16 17:46:52 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-09-16 17:46:52 -0400
commit5e33e08d8476eba830850f9cfab06fad19cf2cb4 (patch)
tree9c2f51c05b45d6efbce68bd667137e4d2a68d13f /bits.c
parent3fae4f0bef5ec7a45b6267f934cc4fd0849ebebf (diff)
downloadgpsd-5e33e08d8476eba830850f9cfab06fad19cf2cb4.tar.gz
Fixing a bug in the function writing a big endian float number.
The previous comment said that calling putbe32 would introduce signedness issue, which is not true here. Also the previous implementation actually returned only one byte of the 32-bit field.
Diffstat (limited to 'bits.c')
-rw-r--r--bits.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bits.c b/bits.c
index f18797c7..2d52d962 100644
--- a/bits.c
+++ b/bits.c
@@ -121,8 +121,7 @@ void putbef32(char *buf, int off, float val)
union int_float i_f;
i_f.f = val;
- /* this would be a putbe32 call if not for a signedness issue */
- buf[off] = (char)(((i_f.i) >> 16) >> 8);
+ putbe32(buf, off, i_f.i);
}
/*@+shiftimplementation@*/