mingw: declare main()'s argv as const
[gitweb.git] / test-path-utils.c
index 0c15f1821f5bdfbe41b462e89bd63240fc4afc70..1ebe0f750c648cd4d92983c11ace9e8a86327dd1 100644 (file)
@@ -49,7 +49,7 @@ static int test_function(struct test_data *data, char *(*func)(char *input),
                if (!data[i].from)
                        to = func(NULL);
                else {
-                       strcpy(buffer, data[i].from);
+                       xsnprintf(buffer, sizeof(buffer), "%s", data[i].from);
                        to = func(buffer);
                }
                if (!strcmp(to, data[i].to))
@@ -156,7 +156,7 @@ static struct test_data dirname_data[] = {
        { NULL,              NULL     }
 };
 
-int main(int argc, char **argv)
+int cmd_main(int argc, const char **argv)
 {
        if (argc == 3 && !strcmp(argv[1], "normalize_path_copy")) {
                char *buf = xmallocz(strlen(argv[2]));
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
        }
 
        if (argc >= 4 && !strcmp(argv[1], "prefix_path")) {
-               char *prefix = argv[2];
+               const char *prefix = argv[2];
                int prefix_len = strlen(prefix);
                int nongit_ok;
                setup_git_directory_gently(&nongit_ok);