commit c8d30e278f86c9904a947c6b334237c044b5ed8d
parent 4453a7f29c4c8c57be47d899a659f194904edce2
Auteur: Selve <selve@asteride.xyz>
Date: Wed, 24 Jan 2024 20:43:22 -0500
ajout d'assertions à meta.c
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/meta.c b/meta.c
@@ -1,3 +1,4 @@
+#include <assert.h>
#include <stdio.h>
#include "tampon.h"
@@ -9,6 +10,9 @@ static void m_reinit(struct meta *);
int
m_init(struct meta *m, size_t tll)
{
+ assert(m != NULL);
+ assert(tll >= 1);
+
if (tp_init(&m->tp, tll) < 0)
return -1;
m->draps = 0;
@@ -23,6 +27,9 @@ m_init(struct meta *m, size_t tll)
int
m_lire(FILE *f, struct meta *m)
{
+ assert(f != NULL);
+ assert(m != NULL);
+
char c;
m_reinit(m);
@@ -55,6 +62,8 @@ m_lire(FILE *f, struct meta *m)
static void
m_reinit(struct meta *m)
{
+ assert(m != NULL);
+
tp_eff(&m->tp);
m->draps = 0;
}