Skip to content

Commit

Permalink
Merge pull request #114 from eseiler/fix/sprintf
Browse files Browse the repository at this point in the history
[FIX] 'sprintf' is deprecated
  • Loading branch information
eseiler committed Jul 20, 2023
2 parents e7c2b10 + d035a83 commit 94face7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/sdsl/int_vector_mapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ class temp_file_buffer
throw std::runtime_error("could not create temporary file.");
}
#else
sprintf(tmp_file_name, "%s/tmp_mapper_file_%" PRIu64 "_XXXXXX.sdsl", dir.c_str(), util::pid());
snprintf(tmp_file_name,
sizeof(tmp_file_name),
"%s/tmp_mapper_file_%" PRIu64 "_XXXXXX.sdsl",
dir.c_str(),
util::pid());
int fd = mkstemps(tmp_file_name, 5);
if (fd == -1)
{
Expand Down

0 comments on commit 94face7

Please sign in to comment.