From 4766abd773b09d04f9b31956fdc6bf0a808f7c37 Mon Sep 17 00:00:00 2001 From: Justin Reichardt Date: Wed, 25 Aug 2021 21:31:38 -0500 Subject: [PATCH] main checks for error returns If parse_config or preserve_static_entries returns an error, main will report it and close with an error. --- src/rhosts.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rhosts.c b/src/rhosts.c index 8dec537..d839dd4 100644 --- a/src/rhosts.c +++ b/src/rhosts.c @@ -17,8 +17,16 @@ int main(int argc, char *argv[]){ rc = openfile(&downloadfile, "w+", TMPDOWNLOADLOCATION); if (rc != 0){return rc;} - parse_config(&entries); + rc = parse_config(&entries); + if (rc != 0){ + printf("%d - parse_config failed",rc); + return rc; + } rc = preserve_static_entries(); + if (rc != 0){ + printf("%d - preserve_static_entries failed",rc); + return rc; + } // Closing files before exiting