1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-10-02 14:31:05 +02:00

FIX: a bug that was leading to Python and valgrind errors

This commit is contained in:
q-posev 2021-08-31 12:11:22 +03:00
parent ced8210ff0
commit 3e82fd9ae8

View File

@ -727,7 +727,7 @@ trexio_open(const char* file_name, const char mode,
/* Data for the parent type */
strncpy(result->file_name, file_name, TREXIO_MAX_FILENAME_LENGTH-1);
strncpy(result->file_name, file_name, TREXIO_MAX_FILENAME_LENGTH);
if (result->file_name[TREXIO_MAX_FILENAME_LENGTH-1] != '\0') {
free(result);
return NULL;