}
cdbus = cdb_fetch(CDB_USERS, usernamekey, strlen(usernamekey));
- if (cdbus.len == 0) { // user not found
+ if (cdbus.ptr == NULL) { // user not found
return(1);
}
if (usbuf != NULL) {
// Fetch the user record using the old index format
cdbus = cdb_fetch(CDB_USERS, oldkey, strlen(oldkey));
- if (cdbus.len == 0) {
+ if (cdbus.ptr == NULL) {
syslog(LOG_INFO, "user_ops: <%s> not found, were they already reindexed?", username);
return;
}
vbuf->v_usernum = rel_user->usernum;
cdbvisit = cdb_fetch(CDB_VISIT, vbuf, (sizeof(long)*3));
- if (cdbvisit.len > 0) {
- memcpy(vbuf, cdbvisit.ptr, ((cdbvisit.len > sizeof(struct visit)) ? sizeof(struct visit) : cdbvisit.len));
+ if (cdbvisit.ptr != NULL) {
+ memcpy(vbuf, cdbvisit.ptr, ((cdbvisit.len > sizeof(struct visit)) ? sizeof(struct visit) : cdbvisit.len));
}
else {
// If this is the first time the user has seen this room, set the view to be the default for the room.
int r;
cdbun = cdb_fetch(CDB_USERSBYNUMBER, &number, sizeof(long));
- if (cdbun.len == 0) {
+ if (cdbun.ptr == NULL) {
syslog(LOG_INFO, "user_ops: %ld not found", number);
return(-1);
}
// No, we don't use CtdlForEachUser() because that requires multiple reads for each record
// TODO: make an index
cdb_rewind(CDB_USERS);
- while (cdbus = cdb_next_item(CDB_USERS), cdbus.len>0) {
+ while (cdbus = cdb_next_item(CDB_USERS), cdbus.ptr!=NULL) {
usptr = (struct ctdluser *) cdbus.ptr;
if (usptr->uid == number) {
cdb_rewind(CDB_USERS);
// Phase 1 : build an array of all our user account names
- while (cdbus = cdb_next_item(CDB_USERS), cdbus.len > 0) {
+ while (cdbus = cdb_next_item(CDB_USERS), cdbus.ptr!=NULL) {
usptr = (struct ctdluser *) cdbus.ptr;
if (strlen(usptr->fullname) > 0) {
array_append(all_users, usptr->fullname);