X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=filter.c;h=2ea5a2dd77bfa3acafa196f5f324a7b47cee2ed6;hb=0e98461940cbb36816b14dc54a0defa1ed0fc920;hp=b6cb98f9ba532d4ea8ac0a583a1f52157de93c1e;hpb=6e550af8a907a680dc845c22a7d6c36d89e900c1;p=pkg%2Fabook.git diff --git a/filter.c b/filter.c index b6cb98f..2ea5a2d 100644 --- a/filter.c +++ b/filter.c @@ -2647,7 +2647,7 @@ parse_custom_format(char *s, char *fmt_string, enum field_types *ft) cannotparse: fprintf(stderr, _("%s: invalid format, index %ld\n"), __FUNCTION__, (start - s)); free(fmt_string); - while(*ft) free(ft--); + free(ft); exit(EXIT_FAILURE); } @@ -2723,11 +2723,10 @@ extern char custom_format[FORMAT_STRING_LEN]; static int custom_export_database(FILE *out, struct db_enumerator e) { - char *format_string = - (char *)malloc(FORMAT_STRING_LEN * sizeof(char*)); + char *format_string = (char *)malloc(FORMAT_STRING_LEN); enum field_types *ft = - (enum field_types *)malloc(FORMAT_STRING_MAX_FIELDS * sizeof(enum field_types *)); + (enum field_types *)malloc(FORMAT_STRING_MAX_FIELDS * sizeof(enum field_types)); parse_custom_format(custom_format, format_string, ft);