commit ac3e634f7644765213cc242dfad9e765b223cedf
parent 755a6df5675a40a81c66bdacc43d029fd349247f
Author: Mario Rosell R. Martinez <mario@mariorosell.es>
Date: Fri, 3 Apr 2026 16:15:16 +0200
hardening: header guards
Forgot to add header guards to all headers. Basically stops you from importing a
header twice accidentally.
By the way, now *ever* header should have this at the start:
/*
* my-header.h -- description
*/
#ifndef MY_HEADER_H
#define MY_HEADER_H
followed by the source, and end with
#endif /* MY_HEADER_H */
I wil add this soon to a CONTRIBUTING or HACKING file or whatever :P.
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/cli.h b/cli.h
@@ -2,5 +2,10 @@
* cli.h -- cli() function
*/
+#ifndef CLI_H
+#define CLI_H
+
void cli(int, char**);
+#endif /* CLI_H */
+
diff --git a/stat.h b/stat.h
@@ -2,6 +2,9 @@
* stat.h -- status
*/
+#ifndef STAT_H
+#define STAT_H
+
#include <stdbool.h>
struct stat {
@@ -17,3 +20,5 @@ extern stat_t stat;
void initstat(void);
+#endif /* STAT_H */
+