- client: replace % with %% in messages from scheduler

(else they're interpreted as format strings)


svn path=/trunk/boinc/; revision=23379
This commit is contained in:
David Anderson 2011-04-19 05:07:08 +00:00
parent a225fe12ba
commit 654f2468f6
3 changed files with 12 additions and 1 deletions

View File

@ -2306,3 +2306,11 @@ David 18 Apr 2011
html/inc/
friend.inc
David 18 Apr 2011
- client: replace % with %% in messages from scheduler
(else they're interpreted as format strings)
client/
client_state.h
cs_scheduler.cpp

View File

@ -211,6 +211,7 @@ struct CLIENT_STATE {
void all_projects_list_check();
double new_version_check_time;
double all_projects_list_check_time;
// the time we last successfully fetched the project list
string newer_version;
// --------------- client_state.cpp:

View File

@ -577,7 +577,9 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url)
for (i=0; i<sr.messages.size(); i++) {
USER_MESSAGE& um = sr.messages[i];
int prio = (!strcmp(um.priority.c_str(), "notice"))?MSG_SCHEDULER_ALERT:MSG_INFO;
msg_printf(project, prio, um.message.c_str());
char buf[1024];
string_substitute(um.message.c_str(), buf, sizeof(buf), "%", "%%");
msg_printf(project, prio, buf);
}
if (log_flags.sched_op_debug && sr.request_delay) {