mirror of https://github.com/BOINC/boinc.git
MGR: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
This commit is contained in:
parent
c3308339b5
commit
a8fa16b660
|
@ -1616,7 +1616,7 @@ void CAdvancedFrame::OnLaunchNewInstance(wxCommandEvent& WXUNUSED(event)) {
|
||||||
err = GetProcessInformation(&myPSN, &pInfo);
|
err = GetProcessInformation(&myPSN, &pInfo);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
procName[procName[0]+1] = '\0'; // Convert pascal string to C string
|
procName[procName[0]+1] = '\0'; // Convert pascal string to C string
|
||||||
sprintf(s, "open -n \"/Applications/%s.app\" --args --multiple", procName+1);
|
snprintf(s, sizeof(s), "open -n \"/Applications/%s.app\" --args --multiple", procName+1);
|
||||||
system(s);
|
system(s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -818,10 +818,11 @@ void CSimpleTaskPanel::GetApplicationAndProjectNames(RESULT* result, wxString* a
|
||||||
strAppBuffer = wxString(state_result->avp->app_name, wxConvUTF8);
|
strAppBuffer = wxString(state_result->avp->app_name, wxConvUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[256];
|
|
||||||
if (avp->gpu_type) {
|
if (avp->gpu_type) {
|
||||||
sprintf(buf, " (%s)", proc_type_name(avp->gpu_type));
|
strGPUBuffer.Printf(
|
||||||
strGPUBuffer = wxString(buf, wxConvUTF8);
|
wxT(" (%s)"),
|
||||||
|
wxString(proc_type_name(avp->gpu_type), wxConvUTF8).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
appName->Printf(
|
appName->Printf(
|
||||||
|
@ -902,7 +903,7 @@ void CSimpleTaskPanel::FindSlideShowFiles(TaskSelectionData *selData) {
|
||||||
if (state_result) {
|
if (state_result) {
|
||||||
url_to_project_dir(state_result->project->master_url, urlDirectory);
|
url_to_project_dir(state_result->project->master_url, urlDirectory);
|
||||||
for(j=0; j<99; ++j) {
|
for(j=0; j<99; ++j) {
|
||||||
sprintf(fileName, "%s/slideshow_%s_%02d", urlDirectory, state_result->app->name, j);
|
snprintf(fileName, sizeof(fileName), "%s/slideshow_%s_%02d", urlDirectory, state_result->app->name, j);
|
||||||
if(boinc_resolve_filename(fileName, resolvedFileName, sizeof(resolvedFileName)) == 0) {
|
if(boinc_resolve_filename(fileName, resolvedFileName, sizeof(resolvedFileName)) == 0) {
|
||||||
if (boinc_file_exists(resolvedFileName)) {
|
if (boinc_file_exists(resolvedFileName)) {
|
||||||
selData->slideShowFileNames.Add(wxString(resolvedFileName,wxConvUTF8));
|
selData->slideShowFileNames.Add(wxString(resolvedFileName,wxConvUTF8));
|
||||||
|
@ -914,7 +915,7 @@ void CSimpleTaskPanel::FindSlideShowFiles(TaskSelectionData *selData) {
|
||||||
|
|
||||||
if ( selData->slideShowFileNames.size() == 0 ) {
|
if ( selData->slideShowFileNames.size() == 0 ) {
|
||||||
for(j=0; j<99; ++j) {
|
for(j=0; j<99; ++j) {
|
||||||
sprintf(fileName, "%s/slideshow_%02d", urlDirectory, j);
|
snprintf(fileName, sizeof(fileName), "%s/slideshow_%02d", urlDirectory, j);
|
||||||
if(boinc_resolve_filename(fileName, resolvedFileName, sizeof(resolvedFileName)) == 0) {
|
if(boinc_resolve_filename(fileName, resolvedFileName, sizeof(resolvedFileName)) == 0) {
|
||||||
if (boinc_file_exists(resolvedFileName)) {
|
if (boinc_file_exists(resolvedFileName)) {
|
||||||
selData->slideShowFileNames.Add(wxString(resolvedFileName,wxConvUTF8));
|
selData->slideShowFileNames.Add(wxString(resolvedFileName,wxConvUTF8));
|
||||||
|
|
Loading…
Reference in New Issue