diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-02-07 19:07:58 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-02-08 08:44:08 +0000 |
commit | d2cd1236a8638eeee39d78187e76572ed6bfc19d (patch) | |
tree | e7c4259536713c585166ae1f8bb6c219574ff173 /psycopg | |
parent | 3e12522bc926609b33079746085222301b68bcac (diff) | |
download | psycopg2-d2cd1236a8638eeee39d78187e76572ed6bfc19d.tar.gz |
Dropped compiler warning about signed/unsigned comparisons
Diffstat (limited to 'psycopg')
-rw-r--r-- | psycopg/adapter_qstring.c | 2 | ||||
-rw-r--r-- | psycopg/pqpath.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/psycopg/adapter_qstring.c b/psycopg/adapter_qstring.c index 73579c5..590ffea 100644 --- a/psycopg/adapter_qstring.c +++ b/psycopg/adapter_qstring.c @@ -77,7 +77,7 @@ qstring_quote(qstringObject *self) goto exit; } - if (qlen > (size_t) PY_SSIZE_T_MAX) { + if (qlen > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_IndexError, "PG buffer too large to fit in Python buffer."); goto exit; diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 50bd520..a268dac 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -713,7 +713,7 @@ pq_get_guc_locked( Dprintf("pq_get_guc_locked: reading %s", param); size = PyOS_snprintf(query, sizeof(query), "SHOW %s", param); - if (size >= sizeof(query)) { + if (size < 0 || (size_t)size >= sizeof(query)) { *error = strdup("SHOW: query too large"); goto cleanup; } @@ -778,7 +778,7 @@ pq_set_guc_locked( size = PyOS_snprintf(query, sizeof(query), "SET %s TO '%s'", param, value); } - if (size >= sizeof(query)) { + if (size < 0 || (size_t)size >= sizeof(query)) { *error = strdup("SET: query too large"); } |