summaryrefslogtreecommitdiff
path: root/8/part1.c
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-12-09 11:48:26 +0100
committerBond_009 <bond.009@outlook.com>2020-12-09 11:48:26 +0100
commit6ee8e076d0b8630c4d78e7e88f1e44f5c7ba3854 (patch)
treefd6dc253c524cbd71e4dba867e8ad16292f9115b /8/part1.c
parentd1aefe3ee5b1c38bc00262670fb67b1362fbc61d (diff)
Git commit stack alloc when sensible
Diffstat (limited to '8/part1.c')
-rw-r--r--8/part1.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/8/part1.c b/8/part1.c
index 6dbb058..d4261be 100644
--- a/8/part1.c
+++ b/8/part1.c
@@ -1,8 +1,6 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
-#include <malloc.h>
-#include <string.h>
#define INPUT_LEN 650
@@ -20,7 +18,7 @@ int exe_program(const char *filename)
// Include space for newline and string terminator
char buffer[16] = { 0 };
- struct Operation *ops = malloc(INPUT_LEN * sizeof(struct Operation));
+ struct Operation ops[INPUT_LEN];
size_t opcount = 0;
while (fgets(buffer, 16, file)) {