Removing unnecessary functions.
h3rald h3rald@h3rald.com
Wed, 10 Jun 2026 16:19:25 +0200
1 files changed,
4 insertions(+),
19 deletions(-)
jump to
M
src/conver.c
→
src/conver.c
@@ -66,7 +66,6 @@ return CONVER_ERR_MKDIR;
#endif } - static conver_result_t fs_open_write(const char *path, const char *mode, const void *data, size_t size) { FILE *f = fopen(path, mode);@@ -84,10 +83,6 @@ }
conver_result_t fs_file_create(const char *path) { return fs_open_write(path, "w", NULL, 0); -} - -conver_result_t fs_file_create_b(const char *path) { - return fs_open_write(path, "wb", NULL, 0); } conver_result_t fs_write(const char *path, const char *text) {@@ -97,10 +92,6 @@ while (*p++) len++;
return fs_open_write(path, "w", text, len); } -conver_result_t fs_write_b(const char *path, const void *data, size_t size) { - return fs_open_write(path, "wb", data, size); -} - conver_result_t fs_append(const char *path, const char *text) { size_t len = 0; const char *p = text;@@ -108,12 +99,7 @@ while (*p++) len++;
return fs_open_write(path, "a", text, len); } -conver_result_t fs_append_b(const char *path, const void *data, size_t size) { - return fs_open_write(path, "ab", data, size); -} - -static conver_result_t fs_read_all(const char *path, const char *mode, - void **out_buf, size_t *out_len, int nul_term) { +static conver_result_t fs_read_all(const char *path, const char *mode, void **out_buf, size_t *out_len, int nul_term) { *out_buf = NULL; if (out_len) *out_len = 0;@@ -149,10 +135,6 @@ }
conver_result_t fs_read(const char *path, char **out_buf, size_t *out_len) { return fs_read_all(path, "r", (void **)out_buf, out_len, 1); -} - -conver_result_t fs_read_b(const char *path, unsigned char **out_buf, size_t *out_len) { - return fs_read_all(path, "rb", (void **)out_buf, out_len, 0); } //// Commands@@ -337,6 +319,9 @@ if (result != CONVER_OK) {
return print_result(result); } printf(release); + memset(date, 0, sizeof(date)); + memset(comment, 0, sizeof(comment)); + memset(release, 0, sizeof(release)); return 0; }