commit 84d7ef8ff2a222a97f7a9737042d823407ec105f
parent 2fba55c5e8039b5ba1ab87f7508debce8ce342b2
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date: Sun, 9 Aug 2015 11:13:40 +0200
Group assignment and check
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/logswan.c b/src/logswan.c
@@ -4,7 +4,7 @@
/* https://github.com/fcambus/logswan */
/* */
/* Created: 2015/05/31 */
-/* Last Updated: 2015/07/19 */
+/* Last Updated: 2015/08/09 */
/* */
/* Logswan is released under the BSD 3-Clause license. */
/* See LICENSE file for details. */
@@ -105,8 +105,7 @@ int main (int argc, char *argv[]) {
printf("Processing file : %s\n\n", intputFile);
- logFile = fopen(intputFile, "r");
- if (!logFile) {
+ if (!(logFile = fopen(intputFile, "r"))) {
perror("Can't open log file");
return EXIT_FAILURE;
}
@@ -116,8 +115,7 @@ int main (int argc, char *argv[]) {
char *outputFile = malloc(outputLen);
snprintf(outputFile, outputLen, "%s%s", intputFile, ".json");
- jsonFile = fopen(outputFile, "w");
- if (!jsonFile) {
+ if (!(jsonFile = fopen(outputFile, "w"))) {
perror("Can't create output file");
return EXIT_FAILURE;
}