Git 2.1.0-rc1
[gitweb.git] / builtin / clean.c
index 9a9151575d3a8d4eb16d73e432835d3cda4374b8..1032563e5fae880df9256c9eafaa96d60462ecd2 100644 (file)
@@ -48,7 +48,7 @@ enum color_clean {
        CLEAN_COLOR_PROMPT = 2,
        CLEAN_COLOR_HEADER = 3,
        CLEAN_COLOR_HELP = 4,
-       CLEAN_COLOR_ERROR = 5,
+       CLEAN_COLOR_ERROR = 5
 };
 
 #define MENU_OPTS_SINGLETON            01
@@ -621,8 +621,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
                                nr += chosen[i];
                }
 
-               result = xmalloc(sizeof(int) * (nr + 1));
-               memset(result, 0, sizeof(int) * (nr + 1));
+               result = xcalloc(nr + 1, sizeof(int));
                for (i = 0; i < stuff->nr && j < nr; i++) {
                        if (chosen[i])
                                result[j++] = i;