Use constant-time DBufLen instead of O(n) strlen()

This commit is contained in:
Dianne Skoll
2025-08-19 10:21:01 -04:00
parent f366037b8d
commit ac3ee7e22b

View File

@@ -787,7 +787,7 @@ int DoDump(ParsePtr p)
} else {
v = FindVar(DBufValue(&buf), 0);
if (!v) {
if (strlen(DBufValue(&buf)) > VAR_NAME_LEN) {
if (DBufLen(&buf) > VAR_NAME_LEN) {
/* Truncate over-long variable name */
DBufValue(&buf)[VAR_NAME_LEN] = 0;
}