* Fix incorrect error message in case input file opening fails
* Don't close files in case the pointers are invalid
Signed-off-by: David Bauer <mail@david-bauer.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=fritz-tools
-PKG_RELEASE:=1
+PKG_RELEASE:=2
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
if (argc > 1 && optind <= argc) {
in = fopen(argv[optind], "r");
if (!in) {
- perror("Failed to create output file");
+ perror("Failed to open input file");
goto out_bad;
}
}
ret = EXIT_FAILURE;
out:
- fclose(in);
- fclose(out);
+ if (in)
+ fclose(in);
+ if (out)
+ fclose(out);
return ret;
}