summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-15 19:51:21 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-16 21:23:02 +0100
commit4dcdc715910b61a2b58f1ea8ae5f86d041e3c229 (patch)
treec79b58668f4f35861dc902e6a5eccfce7a225497 /src
parentc095a0ef0c585dbb64b0ecf8a148a50918f83474 (diff)
Don't use variable-length arrays
They're not supported by MSVC.
Diffstat (limited to 'src')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 43155d5..7818f00 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,13 +28,14 @@ int main(int argc, char *argv[])
{
int i, numfps = 0;
bool ast = false;
- int files[argc];
+ int *files;
unsigned char buffer[4096];
cmark_doc_parser *parser;
size_t offset;
node_block *document;
parser = cmark_new_doc_parser();
+ files = (int *)malloc(argc * sizeof(*files));
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "--version") == 0) {
@@ -99,5 +100,7 @@ int main(int argc, char *argv[])
cmark_free_blocks(document);
end_timer("free_blocks");
+ free(files);
+
return 0;
}