summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-10-26 01:10:03 +0000
committerFederico Di Gregorio <fog@initd.org>2005-10-26 01:10:03 +0000
commitd67b171eede2c1749f28db93c9663badd399480e (patch)
tree9ae22f663bb83f14a05149ed8f780c65865d576b
parent0a73b75c5189f168a64e2583b30349f0978d113e (diff)
downloadpsycopg2-d67b171eede2c1749f28db93c9663badd399480e.tar.gz
Fixed problem with .callproc().
-rw-r--r--psycopg/cursor_type.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c
index b446513..eddab93 100644
--- a/psycopg/cursor_type.c
+++ b/psycopg/cursor_type.c
@@ -890,7 +890,7 @@ psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs)
}
/* allocate some memory, build the SQL and create a PyString from it */
- sl = strlen(procname) + 10 + nparameters*3;
+ sl = strlen(procname) + 10 + nparameters*3 - (nparameters ? 1 : 0);
sql = (char*)PyMem_Malloc(sl);
if (sql == NULL) return NULL;