mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Fix misuse of "%*s" in sprintf strings
%*s takes the output length, not the input length. The intended
specifier was %.*s in several places. Bug(s) introduced in
2bb31f05ee
This commit is contained in:
@@ -486,7 +486,7 @@ mdb_sql_add_sarg(MdbSQL *sql, char *col_name, int op, char *constant)
|
||||
** column definition can be checked for validity
|
||||
*/
|
||||
if (constant[0]=='\'') {
|
||||
snprintf(node->value.s, sizeof(node->value.s), "%*s", (int)strlen(constant) - 2, &constant[1]);
|
||||
snprintf(node->value.s, sizeof(node->value.s), "%.*s", (int)strlen(constant) - 2, &constant[1]);
|
||||
node->val_type = MDB_TEXT;
|
||||
} else if ((p=strchr(constant, '.'))) {
|
||||
*p=localeconv()->decimal_point[0];
|
||||
|
||||
Reference in New Issue
Block a user