Skip to content

Commit

Permalink
Fix a regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbalmer committed Feb 6, 2014
1 parent bc26c4a commit 65f3b3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions luapgsql.c
Expand Up @@ -404,9 +404,10 @@ get_sql_params(lua_State *L, int t, int n, Oid *paramTypes, char **paramValues)
v = lua_tonumber(L, t);
if (paramTypes != NULL)
paramTypes[n] = NUMERICOID;
if (paramValues != NULL &&
asprintf(&paramValues[n], "%f", v) != -1)
n = 1;
if (paramValues != NULL)
if (asprintf(&paramValues[n], "%f", v) == -1)
paramValues[n] = NULL;
n = 1;
break;
case LUA_TSTRING:
if (paramTypes != NULL)
Expand Down

0 comments on commit 65f3b3a

Please sign in to comment.