Fix compiler problems with gcc 7, https://bugs.gentoo.org/641990. Recent gcc rejects ‹PString› == '\0'. I'm trying to work out what the code actually was doing in those gcc versions where it did compile. My assumption is that '\0' would get treated as ((const char*)null_ptr). include/ptlib/contain.inl says PString::operator==(const char *cstr) does an InternalCompare invocation which is implemented in src/ptlib/common/contain.cxx. That has an explicit check for NULL, and in that case will do an IsEmpty() check, which in turn tests for NULL array or '\0' at beginning of array. This the proposed fix is to call IsEmpty directly. diff --git a/src/ptclib/podbc.cxx b/src/ptclib/podbc.cxx index 096413dbe..51f918197 100644 --- a/src/ptclib/podbc.cxx +++ b/src/ptclib/podbc.cxx @@ -1217,7 +1217,7 @@ PString PODBCRecord::GetLongData(PINDEX Column) while (InternalGetData((USHORT)Column,sbin.GetPointer(len + 1),len,&cb)) { - if (sbin.Right(1) == '\0') // Remove Null Char + if (sbin.Right(1).IsEmpty()) // Remove Null Char Data = Data + sbin.Left(sbin.GetLength()-1); else Data = Data + sbin;