Skip to content

Commit

Permalink
Coding - use stsprintf() instead of sprintf() in StProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
gkv311 committed Aug 31, 2024
1 parent 75e48be commit b7b47c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion StShared/StProcess2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ StArrayList<StString> StProcess::getArguments() {
}
#elif (defined(__linux__) || defined(__linux))
stUtf8_t aCmdlineInfoFile[4096];
sprintf(aCmdlineInfoFile, "/proc/%d/cmdline", getpid());
stsprintf(aCmdlineInfoFile, 4096, "/proc/%d/cmdline", getpid());
std::ifstream iFile;
iFile.open(aCmdlineInfoFile);
if(iFile.is_open()) {
Expand Down
2 changes: 1 addition & 1 deletion include/StSocket/StCheckUpdates.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class StCheckUpdates {

const StVersionInfo aCurrVer = StVersionInfo::getSDKVersionInfo();
char anUrl[2048];
sprintf(anUrl, THE_URL_TEMPLATE, aCurrVer.getYear(), aCurrVer.getMonth(), aCurrVer.getReleaseStatus(), aCurrVer.getSubVersion());
stsprintf(anUrl, 2048, THE_URL_TEMPLATE, aCurrVer.getYear(), aCurrVer.getMonth(), aCurrVer.getReleaseStatus(), aCurrVer.getSubVersion());

const StString anAnswer = StRawFile::readTextFile(StString(anUrl));
if(anAnswer.isEmpty()) {
Expand Down

0 comments on commit b7b47c3

Please sign in to comment.