From e613880922beaf1e80274aa183aa5ac0a9d09ac4 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 19 Sep 2011 11:40:40 -0400 Subject: [PATCH] RUBY-327 --- ext/cbson/cbson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/cbson/cbson.c b/ext/cbson/cbson.c index ae46e40..5d0db61 100644 --- a/ext/cbson/cbson.c +++ b/ext/cbson/cbson.c @@ -904,7 +904,7 @@ static VALUE objectid_generate(int argc, VALUE* args, VALUE self) if(argc == 0 || (argc == 1 && *args == Qnil)) { t = htonl((int)time(NULL)); } else { - t = htonl(FIX2INT(rb_funcall(*args, rb_intern("to_i"), 0))); + t = htonl(NUM2UINT(rb_funcall(*args, rb_intern("to_i"), 0))); } MEMCPY(&oid_bytes, &t, unsigned char, 4);