- if (nttlist == NULL) break;
- if (IsEmptyStr(nttlist)) break;
- ptr = malloc(strlen(nttlist));
- if (ptr == NULL) break;
- strcpy(ptr, "");
- for (i = 0; i < num_tokens(nttlist, '|'); ++i) {
- extract_token(buf, nttlist, i, '|', sizeof buf);
- if ( (!IsEmptyStr(buf))
- && (strcasecmp(buf, nodename)) ) {
- strcat(ptr, buf);
- strcat(ptr, "|");
- }
- }
- free(nttlist);
- nttlist = ptr;
+ if ((nttlist == NULL) ||
+ (GetCount(nttlist) == 0))
+ break;
+ Pos = GetNewHashPos(nttlist, 1);
+ GetHashPosFromKey (nttlist, nodename, len, Pos);
+
+ DeleteEntryFromHash(nttlist, Pos);
+ DeleteHashPos(&Pos);
+ syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename);
+