aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-08-02 18:04:26 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-08-02 18:04:26 +0200
commit81d3ee66b56192909fe607558f1c1e6c899e4af6 (patch)
tree3ae6229d6add1cb98d3e27549d8799dc7c49951e
parente241e977ab343c70ced093178db682dd9f3441d9 (diff)
downloadproperties-81d3ee66b56192909fe607558f1c1e6c899e4af6.tar.gz
properties-81d3ee66b56192909fe607558f1c1e6c899e4af6.zip
Check if the file is passed
-rw-r--r--properties.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/properties.y b/properties.y
index 9785e1c..0f8c8d4 100644
--- a/properties.y
+++ b/properties.y
@@ -46,6 +46,11 @@ extern FILE *yyin;
void
properties_load(FILE *file)
{
+ if (file == NULL) {
+ fprintf(stderr, "No file to read.\n");
+ exit(1);
+ }
+
yyin = file;
do {