Skip to content
Permalink
Browse files

reverted to use malloc for dynamic arrays

  • Loading branch information...
Turupawn committed May 26, 2019
1 parent a84df53 commit 4fc60a95717cfcf893ce370de3675213cf1e3031
@@ -1,6 +1,7 @@
#include <stdbool.h>
#include "c/ModioC.h"
#include <stdio.h>
#include <stdlib.h>

bool wait = true;

@@ -40,7 +41,7 @@ int main(void)
if (queue_size != 0)
{
// The download queue contains all the information about the current downloads
ModioQueuedModDownload download_queue[queue_size];
ModioQueuedModDownload *download_queue = malloc(queue_size * sizeof *download_queue);
modioGetModDownloadQueue(download_queue);

printf("\n");
@@ -57,6 +58,7 @@ int main(void)
printf("Download progress: %f%%\n", (current_progress / total_size) * 100.0);
printf("\n");
}
free(download_queue);
}

modioProcess();
@@ -2,6 +2,7 @@
#include "c/ModioC.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

bool wait = true;

@@ -55,7 +56,7 @@ int main(void)
if (queue_size != 0)
{
// The upload queue contains all the information about the current uploads
ModioQueuedModfileUpload upload_queue[queue_size];
ModioQueuedModfileUpload *upload_queue = malloc(queue_size * sizeof *upload_queue);
modioGetModfileUploadQueue(upload_queue);

printf("\n");
@@ -71,6 +72,7 @@ int main(void)
printf("Upload progress: %f%%\n", (current_progress / total_size) * 100.0);
printf("\n");
}
free(upload_queue);
}

modioProcess();
@@ -1,6 +1,7 @@
#include <stdbool.h>
#include "c/ModioC.h"
#include <stdio.h>
#include <stdlib.h>

bool finish = false;

@@ -42,7 +43,7 @@ int main(void)
if (queue_size != 0)
{
// The download queue contains all the information about the current downloads
ModioQueuedModDownload download_queue[queue_size];
ModioQueuedModDownload *download_queue = malloc(queue_size * sizeof *download_queue);
modioGetModDownloadQueue(download_queue);

printf("\n");
@@ -131,6 +132,7 @@ int main(void)
}
}
}
free(download_queue);
}

modioSleep(10);

0 comments on commit 4fc60a9

Please sign in to comment.
You can’t perform that action at this time.