syslog(LOG_DEBUG, "msgbase: CtdlFetchMessage(%ld, %d)", msgnum, with_body);
dmsgtext = cdb_fetch(CDB_MSGMAIN, &msgnum, sizeof(long));
- if (dmsgtext.len == 0) {
+ if (dmsgtext.ptr == NULL) {
syslog(LOG_ERR, "msgbase: message #%ld was not found", msgnum);
return NULL;
}
//
if ( (CM_IsEmpty(ret, eMesageText)) && (with_body) ) {
dmsgtext = cdb_fetch(CDB_BIGMSGS, &msgnum, sizeof(long));
- if (dmsgtext.len > 0) {
+ if (dmsgtext.ptr != NULL) {
CM_SetAsField(ret, eMesageText, &dmsgtext.ptr, dmsgtext.len - 1);
}
}
TheIndex = (0L - msgnum);
cdbsmi = cdb_fetch(CDB_MSGMAIN, &TheIndex, sizeof(long));
- if (cdbsmi.len == 0) {
+ if (cdbsmi.ptr == NULL) {
return; /* record not found; leave it alone */
}
memcpy(smibuf, cdbsmi.ptr, ((cdbsmi.len > sizeof(struct MetaData)) ? sizeof(struct MetaData) : cdbsmi.len));