ldb: use strncmp instead of strcmp when comparing the val part