From 7af295b2ec22f06b24079bf895ac97079f64b6d7 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Thu, 9 Feb 2017 20:03:33 +0100 Subject: It's starting to "properly" reply... The ACSL coverage is far behind though. --- src/storage/storage.c | 12 ++++++++---- src/storage/storage.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/storage') diff --git a/src/storage/storage.c b/src/storage/storage.c index 22c5c49..40185a3 100644 --- a/src/storage/storage.c +++ b/src/storage/storage.c @@ -6,7 +6,7 @@ #include /* defines SIZE_MAX */ #include -#include "../pipe/pipe.h" +#include "../error/error.h" #include "storage.h" @@ -15,12 +15,17 @@ int ZoO_storage_write_line const char filename [const restrict static 1], char line [const restrict static 1], size_t const line_size, - const struct ZoO_pipe io [const restrict static 1] + FILE io [const restrict static 1] ) { const int old_errno = errno; FILE * file; + if (filename == (const char *) NULL) + { + return 0; + } + file = fopen(filename, "a"); if (file == (FILE *) NULL) @@ -53,8 +58,7 @@ int ZoO_storage_write_line ZoO_ERROR ( io, - "Could not store line '%s' in %s.", - line, + "Could not store line in storage file %s.", filename ); diff --git a/src/storage/storage.h b/src/storage/storage.h index c287b23..9eff281 100644 --- a/src/storage/storage.h +++ b/src/storage/storage.h @@ -1,14 +1,14 @@ #ifndef _ZoO_STORAGE_STORAGE_H_ #define _ZoO_STORAGE_STORAGE_H_ -#include "../pipe/pipe_types.h" +#include int ZoO_storage_write_line ( const char filename [const restrict static 1], char line [const restrict static 1], size_t const line_size, - const struct ZoO_pipe io [const restrict static 1] + FILE io [const restrict static 1] ); #endif -- cgit v1.2.3-70-g09d2