}
}
-static char *make_attribute_lines(const char *att_bitmap, struct afs_info *afsi)
+static int make_attribute_lines(const char *att_bitmap, struct afs_info *afsi,
+ char **result)
{
- char *att_text, *att_lines;
+ char *att_text;
+ int ret = get_attribute_text(&afsi->attributes, " ", &att_text);
- get_attribute_text(&afsi->attributes, " ", &att_text);
- if (!att_text)
- return para_strdup(att_bitmap);
- att_lines = make_message("%s: %s\n%s: %s",
+ if (ret < 0)
+ return ret;
+ *result = make_message("%s: %s\n%s: %s",
status_item_list[SI_ATTRIBUTES_BITMAP], att_bitmap,
status_item_list[SI_ATTRIBUTES_TXT], att_text);
free(att_text);
- return att_lines;
+ return 1;
}
static char *make_lyrics_lines(struct afs_info *afsi)
goto out;
}
hash_to_asc(d->hash, asc_hash);
- att_lines = make_attribute_lines(att_buf, afsi);
+ ret = make_attribute_lines(att_buf, afsi, &att_lines);
+ if (ret < 0)
+ goto out;
lyrics_lines = make_lyrics_lines(afsi);
image_lines = make_image_lines(afsi);
filename_lines = make_filename_lines(d->path, opts->flags);