From 15cba69a20498f91ef0d144817f36614dc24fcbc Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Fri, 28 Dec 2018 01:47:50 +0100 Subject: [PATCH] psycopg_escape_string: don't make me cringe Just reformatted. --- psycopg/utils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/psycopg/utils.c b/psycopg/utils.c index 261810fd..4908addb 100644 --- a/psycopg/utils.c +++ b/psycopg/utils.c @@ -55,9 +55,9 @@ psycopg_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, if (len < 0) { len = strlen(from); } else if (strchr(from, '\0') != from + len) { - PyErr_Format(PyExc_ValueError, "A string literal cannot contain NUL (0x00) characters."); - - return NULL; + PyErr_Format(PyExc_ValueError, + "A string literal cannot contain NUL (0x00) characters."); + return NULL; } if (to == NULL) { @@ -69,11 +69,11 @@ psycopg_escape_string(connectionObject *conn, const char *from, Py_ssize_t len, } { - int err; - if (conn && conn->pgconn) - ql = PQescapeStringConn(conn->pgconn, to+eq+1, from, len, &err); - else - ql = PQescapeString(to+eq+1, from, len); + int err; + if (conn && conn->pgconn) + ql = PQescapeStringConn(conn->pgconn, to+eq+1, from, len, &err); + else + ql = PQescapeString(to+eq+1, from, len); } if (eq) {