mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-12-23 04:43:57 +01:00
remove NULL pointer check for file_name in text
This commit is contained in:
parent
d97c111284
commit
047153b7c1
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user