We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29da887 commit b4683edCopy full SHA for b4683ed
oursqlx/_exceptions.c
@@ -618,7 +618,9 @@ enum _oursqlx_exception_type _oursqlx_exc_from_errno(int err) {
618
619
default:
620
#if MYSQL_VERSION_ID >= 50700
621
- for(unsigned int i = 0; i < sizeof(errmsg_section_start)/sizeof(int); ++i) {
+ {
622
+ unsigned int i;
623
+ for(i = 0; i < sizeof(errmsg_section_start)/sizeof(int); ++i) {
624
int min = errmsg_section_start[i];
625
int max = errmsg_section_start[i] + errmsg_section_size[i] - 1;
626
if ( err >= min && err <= max ) {
@@ -628,6 +630,7 @@ enum _oursqlx_exception_type _oursqlx_exc_from_errno(int err) {
628
630
if ( err > CR_MIN_ERROR && err < CR_MAX_ERROR) {
629
631
return _oursqlx_InterfaceError;
632
}
633
+ }
634
#else
635
if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST)
636
return _oursqlx_ProgrammingError;
0 commit comments