diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-03 12:31:24 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-03 12:31:24 -0500 |
commit | f177b644cf4065c2a0c9c14df9609a92c8782f09 (patch) | |
tree | 44adc22e294ba90cd37e62d6e095812ec7ec60b9 /src | |
parent | fca54771279d389fc36625a1333b2bdf6fc0fa63 (diff) | |
download | spmc-f177b644cf4065c2a0c9c14df9609a92c8782f09.tar.gz |
Check for error when opening path_manifest
Diffstat (limited to 'src')
-rw-r--r-- | src/manifest.c | 6 |
1 files changed, 5 insertions, 1 deletions
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++) { |