summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;