projects
/
platform
/
upstream
/
ejdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
520a4e8
)
#51
author
adam
<adamansky@gmail.com>
Mon, 11 Mar 2013 10:57:43 +0000
(17:57 +0700)
committer
adam
<adamansky@gmail.com>
Mon, 11 Mar 2013 10:57:43 +0000
(17:57 +0700)
luaejdb/luabson.c
patch
|
blob
|
history
diff --git
a/luaejdb/luabson.c
b/luaejdb/luabson.c
index
8a37595
..
3855e63
100644
(file)
--- a/
luaejdb/luabson.c
+++ b/
luaejdb/luabson.c
@@
-120,10
+120,7
@@
static void lua_push_bson_array(lua_State *L, bson_iterator *it) {
}
int lua_from_bson(lua_State *L) {
- const void *bsdata = lua_tostring(L, -1);
- if (!bsdata) {
- return luaL_error(L, "luafrombson: BSON binary string must be on top of stack");
- }
+ const void *bsdata = luaL_checkstring(L, lua_gettop(L));
bson_iterator it;
bson_iterator_from_buffer(&it, bsdata);
lua_push_bson_table(L, &it);