From 047153b7c1b1d7efe1ff69b73fb45caa05d4fe4b Mon Sep 17 00:00:00 2001 From: q-posev Date: Tue, 18 May 2021 11:43:05 +0200 Subject: [PATCH] remove NULL pointer check for file_name in text --- src/templates_text/templator_text.org | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/templates_text/templator_text.org b/src/templates_text/templator_text.org index f3a3b0d..3ac096d 100644 --- a/src/templates_text/templator_text.org +++ b/src/templates_text/templator_text.org @@ -145,10 +145,6 @@ trexio_text_init (trexio_t* const file) char file_name[TREXIO_MAX_FILENAME_LENGTH]; - if (file_name == NULL) { - return TREXIO_ALLOCATION_FAILED; - } - strncpy (file_name, file->file_name, TREXIO_MAX_FILENAME_LENGTH); strncat (file_name, lock_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen(lock_file_name)); @@ -273,11 +269,6 @@ trexio_text_read_$group$ (trexio_text_t* const file) /* Build the file name */ const char* $group$_file_name = "/$group$.txt"; - if ($group$->file_name == NULL) { - FREE($group$); - return NULL; - } - strncpy ($group$->file_name, file->parent.file_name, TREXIO_MAX_FILENAME_LENGTH); strncat ($group$->file_name, $group$_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));