Skip to content

Commit 01e97fc

Browse files
committed
Fix strncopy() warning
1 parent 37ed20a commit 01e97fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pdo/pdo_dbh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
8181
pdo_err = &stmt->error_code;
8282
}
8383

84-
strncpy(*pdo_err, sqlstate, 6);
84+
memcpy(*pdo_err, sqlstate, sizeof(pdo_error_type));
8585

8686
/* hash sqlstate to error messages */
8787
msg = pdo_sqlstate_state_to_description(*pdo_err);

0 commit comments

Comments
 (0)