mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Dropped compiler warning about signed/unsigned comparisons
This commit is contained in:
parent
3e12522bc9
commit
d2cd1236a8
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user