Skip to content

Commit

Permalink
Attempt fixing floating point error
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Mar 8, 2017
1 parent 0c2c07a commit 17d96af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Fixed unpacking negative integers using Python2.

* Replaced adding double value with a memcpy.

2017.03.08, Version 0.0.14 (BETA)

* Fixed checking bytes size.
Expand Down
6 changes: 5 additions & 1 deletion qpack/_qpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,11 @@ static PyObject * unpackb(

case 236:
UNPACK_CHECK_SZ(sizeof(double))
obj = PyFloat_FromDouble((double) *((double *) *pt));
{
double d;
memcpy(&d, *pt, sizeof(double));
obj = PyFloat_FromDouble(d);
}
(*pt) += sizeof(double);
return obj;

Expand Down

0 comments on commit 17d96af

Please sign in to comment.