mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-14 04:56:33 +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;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qlen > (size_t) PY_SSIZE_T_MAX) {
|
if (qlen > PY_SSIZE_T_MAX) {
|
||||||
PyErr_SetString(PyExc_IndexError,
|
PyErr_SetString(PyExc_IndexError,
|
||||||
"PG buffer too large to fit in Python buffer.");
|
"PG buffer too large to fit in Python buffer.");
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
|
@ -713,7 +713,7 @@ pq_get_guc_locked(
|
||||||
Dprintf("pq_get_guc_locked: reading %s", param);
|
Dprintf("pq_get_guc_locked: reading %s", param);
|
||||||
|
|
||||||
size = PyOS_snprintf(query, sizeof(query), "SHOW %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");
|
*error = strdup("SHOW: query too large");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -778,7 +778,7 @@ pq_set_guc_locked(
|
||||||
size = PyOS_snprintf(query, sizeof(query),
|
size = PyOS_snprintf(query, sizeof(query),
|
||||||
"SET %s TO '%s'", param, value);
|
"SET %s TO '%s'", param, value);
|
||||||
}
|
}
|
||||||
if (size >= sizeof(query)) {
|
if (size < 0 || (size_t)size >= sizeof(query)) {
|
||||||
*error = strdup("SET: query too large");
|
*error = strdup("SET: query too large");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user