]> git.deb.at Git - pkg/abook.git/blobdiff - filter.c
Import upstream git
[pkg/abook.git] / filter.c
index b6cb98f9ba532d4ea8ac0a583a1f52157de93c1e..2ea5a2dd77bfa3acafa196f5f324a7b47cee2ed6 100644 (file)
--- 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);