aboutsummaryrefslogtreecommitdiff
path: root/vector.c
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-03-23 16:55:45 +0100
committerJulian T <julian@jtle.dk>2020-03-23 16:55:45 +0100
commit83b552b622da561de047f798e5d50d59f724b1eb (patch)
tree5255a785b05aba1f4894062c8576bec15d6d3411 /vector.c
parent8fc5b36510c5964873d88069b61b558bc3ef23f6 (diff)
No dynamic allocation
Diffstat (limited to 'vector.c')
-rw-r--r--vector.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/vector.c b/vector.c
index 87eba37..0bcd1dc 100644
--- a/vector.c
+++ b/vector.c
@@ -4,14 +4,13 @@
#include <string.h>
#include <math.h>
#include <stdio.h>
+#include <assert.h>
static inline vector_t *vector_exists(vector_t *v)
{
- if (v) {
- return v;
- }
+ assert(v);
- return (vector_t *) malloc(sizeof(vector_t));
+ return v;
}
// Overwrites stuff in p. If p is null a new vector is created