diff options
author | Igor Socec <isocec@gmail.com> | 2013-09-16 17:46:52 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-09-16 17:46:52 -0400 |
commit | 5e33e08d8476eba830850f9cfab06fad19cf2cb4 (patch) | |
tree | 9c2f51c05b45d6efbce68bd667137e4d2a68d13f /bits.c | |
parent | 3fae4f0bef5ec7a45b6267f934cc4fd0849ebebf (diff) | |
download | gpsd-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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@*/ |