- if (strcasestr(type, "home") != NULL) {
- item[index] = xstrdup(value);
- }
- if (strcasestr(type, "work") != NULL) {
- item[index+1] = xstrdup(value);
- }
- if (strcasestr(type, "fax") != NULL) {
- item[index+2] = xstrdup(value);
- }
- if (strcasestr(type, "cell") != NULL) {
- item[index+3] = xstrdup(value);
- }
+ if (strcasestr(type, "home") != NULL)
+ item_fput(item, PHONE, xstrdup(value));
+ else if (strcasestr(type, "work") != NULL)
+ item_fput(item, WORKPHONE, xstrdup(value));
+ else if (strcasestr(type, "fax") != NULL)
+ item_fput(item, FAX, xstrdup(value));
+ else if (strcasestr(type, "cell") != NULL)
+ item_fput(item, MOBILEPHONE, xstrdup(value));