Skip to content

Commit 696852f

Browse files
committed
Fixed other compiler warnings in PDO_PGSQL
1 parent 5c06e5c commit 696852f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
315315
case PDO_PARAM_LOB:
316316
/* escapedlen returned by PQescapeBytea() accounts for trailing 0 */
317317
#ifdef HAVE_PQESCAPE_BYTEA_CONN
318-
escaped = PQescapeByteaConn(H->server, unquoted, unquotedlen, &tmp_len);
318+
escaped = PQescapeByteaConn(H->server, (unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len);
319319
#else
320-
escaped = PQescapeBytea(unquoted, unquotedlen, &tmp_len);
320+
escaped = PQescapeBytea((unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len);
321321
#endif
322322
*quotedlen = (int)tmp_len + 1;
323323
*quoted = emalloc(*quotedlen + 1);
@@ -331,9 +331,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
331331
*quoted = safe_emalloc(2, unquotedlen, 3);
332332
(*quoted)[0] = '\'';
333333
#ifndef HAVE_PQESCAPE_CONN
334-
*quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen);
334+
*quotedlen = PQescapeString(*quoted + 1, unquoted, (size_t)unquotedlen);
335335
#else
336-
*quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL);
336+
*quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, (size_t)unquotedlen, NULL);
337337
#endif
338338
(*quoted)[*quotedlen + 1] = '\'';
339339
(*quoted)[*quotedlen + 2] = '\0';

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned
536536
*len = 0;
537537
return 0;
538538
} else {
539-
char *tmp_ptr = PQunescapeBytea(*ptr, &tmp_len);
539+
char *tmp_ptr = (char *)PQunescapeBytea((unsigned char *)*ptr, &tmp_len);
540540
if (!tmp_ptr) {
541541
/* PQunescapeBytea returned an error */
542542
*len = 0;

0 commit comments

Comments
 (0)