Skip to content

Commit 324c2c2

Browse files
committed
JsonLogTask: fix string comparisons
fixes #43
1 parent 477634c commit 324c2c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

caPutLogApp/caPutJsonLogTask.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,9 @@ bool CaPutJsonLogTask::compareValues(const LOGDATA *pLogData) {
831831
case DBR_DOUBLE:
832832
SINGLE_TYPE_COMPARE(double, sizeof(epicsFloat64));
833833
case DBR_STRING:
834-
SINGLE_TYPE_COMPARE(string, MAX_STRING_SIZE);
834+
// Doesn't mask "hidden" bytes (after NUL) for the sake of efficiency
835+
// For string scalars, size == 1
836+
return memcmp(pa->v_string, pb->v_string, size*MAX_STRING_SIZE) == 0;
835837
default:
836838
return 0;
837839
}

0 commit comments

Comments
 (0)