mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-03-04 14:20:19 +01:00
Revert "Fixed strncpy"
This reverts commit 363851314be6712254846016a974baee8f14d028.
This commit is contained in:
parent
363851314b
commit
770b136c59
@ -840,7 +840,7 @@ trexio_string_of_error (const trexio_exit_code error)
|
|||||||
void
|
void
|
||||||
trexio_string_of_error_f (const trexio_exit_code error, char result[<<MAX_STRING_LENGTH()>>])
|
trexio_string_of_error_f (const trexio_exit_code error, char result[<<MAX_STRING_LENGTH()>>])
|
||||||
{
|
{
|
||||||
strncpy(result, trexio_string_of_error(error), <<MAX_STRING_LENGTH()>>-1);
|
strncpy(result, trexio_string_of_error(error), <<MAX_STRING_LENGTH()>>);
|
||||||
result[<<MAX_STRING_LENGTH()>>-1] = '\0';
|
result[<<MAX_STRING_LENGTH()>>-1] = '\0';
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -1291,7 +1291,7 @@ trexio_open(const char* file_name, const char mode,
|
|||||||
|
|
||||||
/* Data for the parent type */
|
/* 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);
|
||||||
result->file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
result->file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
if (result->file_name[TREXIO_MAX_FILENAME_LENGTH-2] != '\0') {
|
if (result->file_name[TREXIO_MAX_FILENAME_LENGTH-2] != '\0') {
|
||||||
if (rc_open != NULL) *rc_open = TREXIO_INVALID_ARG_1;
|
if (rc_open != NULL) *rc_open = TREXIO_INVALID_ARG_1;
|
||||||
|
@ -553,10 +553,8 @@ trexio_hdf5_write_$group_dset$ (trexio_t* const file,
|
|||||||
char dset_index_name[256];
|
char dset_index_name[256];
|
||||||
char dset_value_name[256];
|
char dset_value_name[256];
|
||||||
/* Build the names of the datasets */
|
/* Build the names of the datasets */
|
||||||
strncpy(dset_index_name, $GROUP_DSET$_NAME "_indices", 255);
|
strncpy(dset_index_name, $GROUP_DSET$_NAME "_indices", 256);
|
||||||
strncpy(dset_value_name, $GROUP_DSET$_NAME "_values", 255);
|
strncpy(dset_value_name, $GROUP_DSET$_NAME "_values", 256);
|
||||||
dset_index_name[255]='\0';
|
|
||||||
dset_value_name[255]='\0';
|
|
||||||
|
|
||||||
trexio_exit_code rc_write = TREXIO_FAILURE;
|
trexio_exit_code rc_write = TREXIO_FAILURE;
|
||||||
/* NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed ! */
|
/* NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed ! */
|
||||||
@ -618,10 +616,8 @@ trexio_hdf5_read_$group_dset$ (trexio_t* const file,
|
|||||||
char dset_index_name[256];
|
char dset_index_name[256];
|
||||||
char dset_value_name[256];
|
char dset_value_name[256];
|
||||||
/* Build the names of the datasets */
|
/* Build the names of the datasets */
|
||||||
strncpy(dset_index_name, $GROUP_DSET$_NAME "_indices", 255);
|
strncpy(dset_index_name, $GROUP_DSET$_NAME "_indices", 256);
|
||||||
strncpy(dset_value_name, $GROUP_DSET$_NAME "_values", 255);
|
strncpy(dset_value_name, $GROUP_DSET$_NAME "_values", 256);
|
||||||
dset_index_name[255]='\0';
|
|
||||||
dset_value_name[255]='\0';
|
|
||||||
|
|
||||||
hsize_t offset_i[1] = {(hsize_t) offset_file * $group_dset_rank$};
|
hsize_t offset_i[1] = {(hsize_t) offset_file * $group_dset_rank$};
|
||||||
hsize_t count_i[1] = {(hsize_t) size * $group_dset_rank$};
|
hsize_t count_i[1] = {(hsize_t) size * $group_dset_rank$};
|
||||||
|
@ -221,7 +221,7 @@ trexio_text_init (trexio_t* const file)
|
|||||||
|
|
||||||
char file_name[TREXIO_MAX_FILENAME_LENGTH];
|
char file_name[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
strncpy (file_name, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_name, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
strncat (file_name, lock_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen(lock_file_name));
|
strncat (file_name, lock_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen(lock_file_name));
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ trexio_text_init (trexio_t* const file)
|
|||||||
,*/
|
,*/
|
||||||
char dirname[TREXIO_MAX_FILENAME_LENGTH] = "/tmp/trexio.XXXXXX";
|
char dirname[TREXIO_MAX_FILENAME_LENGTH] = "/tmp/trexio.XXXXXX";
|
||||||
if (mkdtemp(dirname) == NULL) return TREXIO_ERRNO;
|
if (mkdtemp(dirname) == NULL) return TREXIO_ERRNO;
|
||||||
strncpy (file_name, dirname, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_name, dirname, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
strncat (file_name, lock_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen(lock_file_name));
|
strncat (file_name, lock_file_name, TREXIO_MAX_FILENAME_LENGTH-strlen(lock_file_name));
|
||||||
f->lock_file = open(file_name,O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
f->lock_file = open(file_name,O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
||||||
@ -369,7 +369,7 @@ trexio_text_read_$group$ (trexio_text_t* const file)
|
|||||||
/* Build the file name */
|
/* Build the file name */
|
||||||
const char* $group$_file_name = "/$group$.txt";
|
const char* $group$_file_name = "/$group$.txt";
|
||||||
|
|
||||||
strncpy ($group$->file_name, file->parent.file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy ($group$->file_name, file->parent.file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
$group$->file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
$group$->file_name[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
strncat ($group$->file_name, $group$_file_name,
|
strncat ($group$->file_name, $group$_file_name,
|
||||||
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
|
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
|
||||||
@ -488,7 +488,7 @@ trexio_text_read_$group$ (trexio_text_t* const file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t tmp_$group_dset$_len = strlen(buffer);
|
size_t tmp_$group_dset$_len = strlen(buffer);
|
||||||
strncpy(tmp_$group_dset$, buffer, 31);
|
strncpy(tmp_$group_dset$, buffer, 32);
|
||||||
tmp_$group_dset$[31] = '\0';
|
tmp_$group_dset$[31] = '\0';
|
||||||
tmp_$group_dset$ += tmp_$group_dset$_len + 1;
|
tmp_$group_dset$ += tmp_$group_dset$_len + 1;
|
||||||
}
|
}
|
||||||
@ -553,7 +553,7 @@ trexio_text_read_$group$ (trexio_text_t* const file)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* Safer string conversion to avoid buffer overflow in fscanf */
|
/* Safer string conversion to avoid buffer overflow in fscanf */
|
||||||
strncpy($group$->$group_str$, buffer, $group$->len_$group_str$-1);
|
strncpy($group$->$group_str$, buffer, $group$->len_$group_str$);
|
||||||
$group$->$group_str$[$group$->len_$group_str$-1] = '\0';
|
$group$->$group_str$[$group$->len_$group_str$-1] = '\0';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -598,7 +598,7 @@ trexio_text_has_$group$ (trexio_t* const file)
|
|||||||
|
|
||||||
const char* $group$_file_name = "/$group$.txt";
|
const char* $group$_file_name = "/$group$.txt";
|
||||||
|
|
||||||
strncpy ($group$_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy ($group$_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
$group$_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
$group$_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
strncat ($group$_full_path, $group$_file_name,
|
strncat ($group$_full_path, $group$_file_name,
|
||||||
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
|
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
|
||||||
@ -1033,7 +1033,7 @@ trexio_text_read_$group_str$ (trexio_t* const file, char* const str, const uint3
|
|||||||
$group$_t* const $group$ = trexio_text_read_$group$((trexio_text_t*) file);
|
$group$_t* const $group$ = trexio_text_read_$group$((trexio_text_t*) file);
|
||||||
if ($group$ == NULL) return TREXIO_FAILURE;
|
if ($group$ == NULL) return TREXIO_FAILURE;
|
||||||
|
|
||||||
strncpy(str, $group$->$group_str$, max_str_len-1);
|
strncpy(str, $group$->$group_str$, max_str_len);
|
||||||
str[max_str_len-1] = '\0';
|
str[max_str_len-1] = '\0';
|
||||||
|
|
||||||
return TREXIO_SUCCESS;
|
return TREXIO_SUCCESS;
|
||||||
@ -1142,22 +1142,22 @@ trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file,
|
|||||||
CURRENTLY NO OFFSET IS USED WHEN WRITING !
|
CURRENTLY NO OFFSET IS USED WHEN WRITING !
|
||||||
,*/
|
,*/
|
||||||
(void) offset_file; // Avoid unused variable error
|
(void) offset_file; // Avoid unused variable error
|
||||||
|
|
||||||
int64_t line_length = 0L;
|
int64_t line_length = 0L;
|
||||||
char format_str[256];
|
char format_str[256];
|
||||||
|
|
||||||
/* Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num) */
|
/* Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num) */
|
||||||
if (size_max < UINT8_MAX) {
|
if (size_max < UINT8_MAX) {
|
||||||
line_length = $sparse_line_length_8$; // 41 for 4 indices
|
line_length = $sparse_line_length_8$; // 41 for 4 indices
|
||||||
strncpy(format_str, $sparse_format_printf_8$, 255);
|
strncpy(format_str, $sparse_format_printf_8$, 256);
|
||||||
format_str[255] = '\0';
|
format_str[255] = '\0';
|
||||||
} else if (size_max < UINT16_MAX) {
|
} else if (size_max < UINT16_MAX) {
|
||||||
line_length = $sparse_line_length_16$; // 49 for 4 indices
|
line_length = $sparse_line_length_16$; // 49 for 4 indices
|
||||||
strncpy(format_str, $sparse_format_printf_16$, 255);
|
strncpy(format_str, $sparse_format_printf_16$, 256);
|
||||||
format_str[255] = '\0';
|
format_str[255] = '\0';
|
||||||
} else {
|
} else {
|
||||||
line_length = $sparse_line_length_32$; //69 for 4 indices
|
line_length = $sparse_line_length_32$; //69 for 4 indices
|
||||||
strncpy(format_str, $sparse_format_printf_32$, 255);
|
strncpy(format_str, $sparse_format_printf_32$, 256);
|
||||||
format_str[255] = '\0';
|
format_str[255] = '\0';
|
||||||
}
|
}
|
||||||
strncat(format_str, "\n", 2);
|
strncat(format_str, "\n", 2);
|
||||||
@ -1207,7 +1207,7 @@ trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file,
|
|||||||
|
|
||||||
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, $group$_file_name,
|
strncat (file_full_path, $group$_file_name,
|
||||||
@ -1247,7 +1247,7 @@ trexio_exit_code trexio_text_read_$group_dset$(trexio_t* const file,
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, $group_dset$_file_name,
|
strncat (file_full_path, $group_dset$_file_name,
|
||||||
@ -1323,7 +1323,7 @@ trexio_exit_code trexio_text_read_$group_dset$_size(trexio_t* const file, int64_
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, $group_dset$_file_name,
|
strncat (file_full_path, $group_dset$_file_name,
|
||||||
@ -1374,7 +1374,7 @@ trexio_exit_code trexio_text_has_$group_dset$(trexio_t* const file)
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, $group_dset$_file_name,
|
strncat (file_full_path, $group_dset$_file_name,
|
||||||
@ -1423,7 +1423,7 @@ trexio_exit_code trexio_text_read_$group_dset$(trexio_t* const file,
|
|||||||
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
||||||
@ -1486,7 +1486,7 @@ trexio_text_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max
|
|||||||
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
||||||
@ -1540,7 +1540,7 @@ trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file,
|
|||||||
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
||||||
@ -1588,7 +1588,7 @@ trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file,
|
|||||||
|
|
||||||
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, group_file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(group_file_name));
|
strncat (file_full_path, group_file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(group_file_name));
|
||||||
@ -1617,7 +1617,7 @@ trexio_exit_code trexio_text_has_$group_dset$(trexio_t* const file)
|
|||||||
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
/* The full path to the destination TXT file with sparse data. This will include TREXIO directory name. */
|
||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
strncat (file_full_path, file_name, TREXIO_MAX_FILENAME_LENGTH - sizeof(file_name));
|
||||||
@ -1693,7 +1693,7 @@ trexio_exit_code trexio_text_read_determinant_list(trexio_t* const file,
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, determinant_list_file_name,
|
strncat (file_full_path, determinant_list_file_name,
|
||||||
@ -1779,7 +1779,7 @@ trexio_exit_code trexio_text_write_determinant_list(trexio_t* const file,
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, determinant_list_file_name,
|
strncat (file_full_path, determinant_list_file_name,
|
||||||
@ -1814,7 +1814,7 @@ trexio_exit_code trexio_text_write_determinant_list(trexio_t* const file,
|
|||||||
|
|
||||||
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, det_file_name,
|
strncat (file_full_path, det_file_name,
|
||||||
@ -1843,7 +1843,7 @@ trexio_exit_code trexio_text_has_determinant_list(trexio_t* const file)
|
|||||||
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
char file_full_path[TREXIO_MAX_FILENAME_LENGTH];
|
||||||
|
|
||||||
/* Copy directory name in file_full_path */
|
/* Copy directory name in file_full_path */
|
||||||
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH-1);
|
strncpy (file_full_path, file->file_name, TREXIO_MAX_FILENAME_LENGTH);
|
||||||
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
file_full_path[TREXIO_MAX_FILENAME_LENGTH-1] = '\0';
|
||||||
/* Append name of the file with sparse data */
|
/* Append name of the file with sparse data */
|
||||||
strncat (file_full_path, determinant_list_file_name,
|
strncat (file_full_path, determinant_list_file_name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user