From f177b644cf4065c2a0c9c14df9609a92c8782f09 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 3 Mar 2020 12:31:24 -0500 Subject: Check for error when opening path_manifest --- src/manifest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/manifest.c b/src/manifest.c index f384e8c..878ab5b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -204,8 +204,12 @@ int manifest_write(Manifest *info, const char *pkgdir) { strcat(path_manifest, SPM_MANIFEST_FILENAME); } - char *asdfasd = path_manifest; FILE *fp = fopen(path_manifest, "w+"); + if (fp == NULL) { + perror(path_manifest); + fprintf(SYSERROR); + return -1; + } #ifdef _DEBUG if (SPM_GLOBAL.verbose) { for (size_t i = 0; i < info->records; i++) { -- cgit