Changeset: d60a33feac0d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d60a33feac0d
Modified Files:
        clients/odbc/driver/ODBCConvert.c
Branch: Mar2025
Log Message:

Use standard C function to test for incorrect characters.


diffs (26 lines):

diff --git a/clients/odbc/driver/ODBCConvert.c 
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -3907,16 +3907,12 @@ ODBCStore(ODBCStmt *stmt,
                                addStmtError(stmt, "22018", NULL, 0);
                                goto failure;
                        }
-                       for (i = 0; i < 36; i++) {
-                               if (strchr("0123456789abcdefABCDEF-",
-                                          sval[i]) == NULL) {
-                                       /* not sure this is the
-                                        * correct error */
-                                       /* Invalid character value for
-                                        * cast specification */
-                                       addStmtError(stmt, "22018", NULL, 0);
-                                       goto failure;
-                               }
+                       if (sval[strspn(sval, "0123456789abcdefABCDEF-")] != 0) 
{
+                               /* not sure this is the correct error */
+                               /* Invalid character value for cast
+                                * specification */
+                               addStmtError(stmt, "22018", NULL, 0);
+                               goto failure;
                        }
                        snprintf(data, sizeof(data), "%.36s", sval);
                        break;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to