mirror of https://github.com/BOINC/boinc.git
parent
c8527aba13
commit
860f814f04
|
@ -1655,14 +1655,18 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
|
|||
// and passes it to show_message
|
||||
// TODO: add translation functionality
|
||||
//
|
||||
void msg_printf(PROJECT *p, int priority, const char *fmt, ...) {
|
||||
char buf[512];
|
||||
void msg_printf(PROJECT *p, int priority, char *fmt, ...) {
|
||||
char buf[512], temp_buf[512];
|
||||
va_list ap;
|
||||
|
||||
if (fmt == NULL) return;
|
||||
|
||||
va_start(ap, fmt); // Parses string for variables
|
||||
vsnprintf(buf, sizeof(buf), fmt, ap); // And convert symbols To actual numbers
|
||||
// Windows doesn't support vsnprintf, so we have to do
|
||||
// this roundabout method to avoid buffer overruns
|
||||
//
|
||||
safe_strncpy(temp_buf, fmt, sizeof(temp_buf));
|
||||
va_start(ap, temp_buf); // Parses string for variables
|
||||
vsprintf(buf, temp_buf, ap); // And convert symbols To actual numbers
|
||||
va_end(ap); // Results are stored in text
|
||||
|
||||
show_message(p, buf, priority);
|
||||
|
|
|
@ -205,6 +205,6 @@ public:
|
|||
|
||||
extern CLIENT_STATE gstate;
|
||||
|
||||
extern void msg_printf(PROJECT *p, int priority, const char *fmt, ...);
|
||||
extern void msg_printf(PROJECT *p, int priority, char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue