From 89cadcb55303ac5457e60b87f4c977a4405fa1b0 Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Thu, 6 Mar 2008 16:15:41 +0000 Subject: [PATCH] 2008-03-07 Jason Erickson * psycopg/psycopgmodule.c (psyco_connect): fix off by one error in calculating the length of the DSN. --- ChangeLog | 5 +++++ psycopg/psycopgmodule.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2bc8dc7f..b50cd7d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-07 Jason Erickson + + * psycopg/psycopgmodule.c (psyco_connect): fix off by one error in + calculating the length of the DSN. + 2008-03-07 James Henstridge * psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index 957c45fb..a26aac1a 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -144,7 +144,7 @@ psyco_connect(PyObject *self, PyObject *args, PyObject *keywds) PyOS_snprintf(port, 16, "%d", iport); if (dsn_static == NULL) { - size_t l = 45; /* len("dbname= user= password= host= port= sslmode=\0") */ + size_t l = 46; /* len(" dbname= user= password= host= port= sslmode=\0") */ if (database) l += strlen(database); if (host) l += strlen(host);