int i;
int ret = 0;
cacheduser_t *entry;
- char *uuidstring = NULL;
char timestr[200];
struct tm *tmp = NULL;
for ( i=0 ; i<256; i++) {
if ((entry = namecache[i]) != NULL) {
do {
- uuid_bin2string(entry->uuid, &uuidstring);
tmp = localtime(&entry->creationtime);
if (tmp == NULL)
continue;
if (strftime(timestr, 200, "%c", tmp) == 0)
continue;
LOG(log_debug9, logtype_default, "namecache{%d}: name:%s, uuid:%s, type: %s, cached: %s",
- i, entry->name, uuidstring, uuidtype[entry->type], timestr);
- free(uuidstring);
+ i, entry->name, uuid_bin2string(entry->uuid), uuidtype[entry->type], timestr);
} while ((entry = entry->next) != NULL);
}
}
for ( i=0; i<256; i++) {
if ((entry = uuidcache[i]) != NULL) {
do {
- uuid_bin2string(entry->uuid, &uuidstring);
+
tmp = localtime(&entry->creationtime);
if (tmp == NULL)
continue;
if (strftime(timestr, 200, "%c", tmp) == 0)
continue;
LOG(log_debug9, logtype_default, "uuidcache{%d}: uuid:%s, name:%s, type: %s, cached: %s",
- i, uuidstring, entry->name, uuidtype[entry->type], timestr);
- free(uuidstring);
+ i, uuid_bin2string(entry->uuid), entry->name, uuidtype[entry->type], timestr);
} while ((entry = entry->next) != NULL);
}
}
return index;
}
-/* hash uuid_t into unsigned char */
+/* hash atalk_uuid_t into unsigned char */
static unsigned char hashuuid(uuidp_t uuid) {
unsigned char index = 83;
int i;
int add_cachebyname( const char *inname, const uuidp_t inuuid, const uuidtype_t type, const unsigned long uid _U_) {
int ret = 0;
char *name = NULL;
- uuidp_t uuid;
+ uuidp_t uuid = NULL;
cacheduser_t *cacheduser = NULL;
unsigned char hash;
int add_cachebyuuid( uuidp_t inuuid, const char *inname, uuidtype_t type, const unsigned long uid _U_) {
int ret = 0;
char *name = NULL;
- uuidp_t uuid;
+ uuidp_t uuid = NULL;
cacheduser_t *cacheduser = NULL;
cacheduser_t *entry;
unsigned char hash;