summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-06-15 10:52:33 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-06-15 10:52:33 -0700
commitaa71fe4777d2667696e420f7ea15326cfbb45aa8 (patch)
tree0f6ee5a4f7665ed2bfedf07640552f5b2810528b /lib
parent8f640b6d665926c6687d6138c8f6485b43c3a857 (diff)
downloadffi-yajl-aa71fe4777d2667696e420f7ea15326cfbb45aa8.tar.gz
fix very large floats in ffi
Diffstat (limited to 'lib')
-rw-r--r--lib/ffi_yajl/ffi/parser.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ffi_yajl/ffi/parser.rb b/lib/ffi_yajl/ffi/parser.rb
index 7c1dbbc..11682dc 100644
--- a/lib/ffi_yajl/ffi/parser.rb
+++ b/lib/ffi_yajl/ffi/parser.rb
@@ -51,7 +51,7 @@ module FFI_Yajl
s = stringval.slice(0,stringlen)
s.force_encoding('UTF-8') if defined? Encoding
# XXX: I can't think of a better way to do this right now. need to call to_f if and only if its a float.
- v = ( s =~ /\./ ) ? s.to_f : s.to_i
+ v = ( s =~ /[\.eE]/ ) ? s.to_f : s.to_i
set_value(v)
1
end