Skip to content

Commit

Permalink
use snprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Mar 28, 2024
1 parent fe9d2a5 commit 5d42801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/file_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ std::string promptForFilename(std::string initName) {

// Register the callback which creates the UI and does the hard work
char* textBuff = new char[2048];
sprintf(textBuff, "%s", initName.c_str());
snprintf(textBuff, sizeof(textBuff), "%s", initName.c_str());
auto func = std::bind(filenamePromptCallback, textBuff, 2048);
pushContext(func);

Expand Down

0 comments on commit 5d42801

Please sign in to comment.