diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-26 20:01:19 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-27 00:29:01 +0100 |
commit | dfe547856ee946163dfdc695723f7ab67865228b (patch) | |
tree | 9143d7beadf2b32efe542e9fe013959bf0861887 /psycopg/pqpath.c | |
parent | a255e4e1c6bbe32b0865da410fecd7be067902a7 (diff) | |
download | psycopg2-dfe547856ee946163dfdc695723f7ab67865228b.tar.gz |
Use -1 instead of 0 to say "calculate the length" in many funcs
0 is a valid length, isn't it?
Diffstat (limited to 'psycopg/pqpath.c')
-rw-r--r-- | psycopg/pqpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 9dbd489..c8d9c46 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -227,7 +227,7 @@ pq_raise(connectionObject *conn, cursorObject *curs, PGresult **pgres) errorObject *perr = (errorObject *)pyerr; PyMem_Free(perr->pyenc); - psycopg_strdup(&perr->pyenc, conn->pyenc, 0); + psycopg_strdup(&perr->pyenc, conn->pyenc, -1); Py_CLEAR(perr->pgerror); perr->pgerror = error_text_from_chars(perr, err); @@ -765,7 +765,7 @@ pq_tpc_command_locked(connectionObject *conn, const char *cmd, const char *tid, PyEval_RestoreThread(*tstate); /* convert the xid into the postgres transaction_id and quote it. */ - if (!(etid = psycopg_escape_string(conn, tid, 0, NULL, NULL))) + if (!(etid = psycopg_escape_string(conn, tid, -1, NULL, NULL))) { goto exit; } /* prepare the command to the server */ |