Skip to content

Fix some minor warnings #8568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/pdo/pdo_dbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void pdo_throw_exception(unsigned int driver_errcode, char *driver_errmsg, pdo_e
zend_throw_exception_object(&pdo_exception);
}

void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp) /* {{{ */
void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, pdo_error_type sqlstate, const char *supp) /* {{{ */
{
pdo_error_type *pdo_err = &dbh->error_code;
char *message = NULL;
Expand All @@ -81,7 +81,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
pdo_err = &stmt->error_code;
}

strncpy(*pdo_err, sqlstate, 6);
memcpy(*pdo_err, sqlstate, sizeof(pdo_error_type));

/* hash sqlstate to error messages */
msg = pdo_sqlstate_state_to_description(*pdo_err);
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/php_pdo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ PDO_API zend_class_entry *php_pdo_get_exception(void);
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, zend_string *inquery, zend_string **outquery);

PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
const char *sqlstate, const char *supp);
pdo_error_type sqlstate, const char *supp);

PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh);
PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh);
Expand Down
2 changes: 1 addition & 1 deletion sapi/apache2handler/php_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ PHP_FUNCTION(apache_getenv)
}
/* }}} */

static char *php_apache_get_version()
static char *php_apache_get_version(void)
{
#if MODULE_MAGIC_NUMBER_MAJOR >= 20060905
return (char *) ap_get_server_banner();
Expand Down