From 81d3ee66b56192909fe607558f1c1e6c899e4af6 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Fri, 2 Aug 2024 18:04:26 +0200 Subject: Check if the file is passed --- properties.y | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- cgit v1.2.3