From: Raphaƫl Droz Date: Thu, 13 Dec 2012 16:01:14 +0000 (+0100) Subject: ldif: cleanup ldif_convert() X-Git-Tag: upstream/0.6.1~2^2~34 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=cd6241eed4fe11f496a88a665acbafba81d5ec51;p=pkg%2Fabook.git ldif: cleanup ldif_convert() * removed the "dirty hack" about LDIF_ITEM_FIELDS * removed a useless free() causing segfaults * don't process "objectclass" fields as we don't do anything about them --- diff --git a/filter.c b/filter.c index ff3e511..520d4ce 100644 --- a/filter.c +++ b/filter.c @@ -630,15 +630,8 @@ ldif_convert(ldif_item item, char *type, char *value) return; } - for(i=0; i < LDIF_ITEM_FIELDS; i++) { + for(i=0; i < LDIF_ITEM_FIELDS - 1; i++) { if(!strcasecmp(ldif_field_names[i], type) && *value) { - if(i == LDIF_ITEM_FIELDS - 1) /* this is a dirty hack */ - if(safe_strcmp("person", value)) - break; - - if(item_fget(item, i)) - free(item_fget(item, i)); - item_fput(item, i, xstrdup(value)); break; }