Commit 4597db96 authored by davidpanderson's avatar davidpanderson

client: tweaks to snprintf params. No functional change

parent e14cef28
......@@ -55,7 +55,7 @@ void show_message(
PROJ_AM *p, char* msg, int priority, bool is_html, const char* link
) {
const char* x;
char message[1024], event_msg[1024], evt_message[2048];
char message[1024], event_msg[2048], evt_message[2048];
double t = dtime();
char* time_string = time_to_string(t);
......@@ -75,10 +75,10 @@ void show_message(
//
switch (priority) {
case MSG_INTERNAL_ERROR:
snprintf(event_msg, sizeof(event_msg), "[error] %.512s", message);
snprintf(event_msg, sizeof(event_msg), "[error] %s", message);
break;
case MSG_SCHEDULER_ALERT:
snprintf(event_msg, sizeof(event_msg), "%.64s: %.512s",
snprintf(event_msg, sizeof(event_msg), "%.64s: %s",
_("Message from server"), message
);
break;
......
......@@ -192,8 +192,8 @@ int FILE_INFO::verify_file(
// see if we need to unzip it
//
if (download_gzipped && !boinc_file_exists(pathname)) {
char gzpath[MAXPATHLEN];
snprintf(gzpath, sizeof(gzpath), "%.2048s.gz", pathname);
char gzpath[MAXPATHLEN+16];
snprintf(gzpath, sizeof(gzpath), "%s.gz", pathname);
if (boinc_file_exists(gzpath) ) {
if (allow_async && nbytes > ASYNC_FILE_THRESHOLD) {
ASYNC_VERIFY* avp = new ASYNC_VERIFY;
......@@ -417,10 +417,10 @@ bool CLIENT_STATE::create_and_delete_pers_file_xfers() {
// If this was a compressed download, rename .gzt to .gz
//
if (fip->download_gzipped) {
char path[MAXPATHLEN], from_path[MAXPATHLEN], to_path[MAXPATHLEN];
char path[MAXPATHLEN], from_path[MAXPATHLEN+16], to_path[MAXPATHLEN+16];
get_pathname(fip, path, sizeof(path));
snprintf(from_path, sizeof(from_path), "%.2048s.gzt", path);
snprintf(to_path, sizeof(to_path), "%.2048s.gz", path);
snprintf(from_path, sizeof(from_path), "%s.gzt", path);
snprintf(to_path, sizeof(to_path), "%s.gz", path);
boinc_rename(from_path, to_path);
}
......
......@@ -59,7 +59,7 @@ static bool cmp(NOTICE n1, NOTICE n2) {
static void project_feed_list_file_name(PROJ_AM* p, char* buf, int len) {
char url[256];
escape_project_url(p->master_url, url);
snprintf(buf, len, "notices/feeds_%.128s.xml", url);
snprintf(buf, len, "notices/feeds_%s.xml", url);
}
// parse feed descs from scheduler reply or feed list file
......@@ -98,7 +98,7 @@ static void write_rss_feed_descs(MIOFILE& fout, vector<RSS_FEED>& feeds) {
}
static void write_project_feed_list(PROJ_AM* p) {
char buf[256];
char buf[MAXPATHLEN];
project_feed_list_file_name(p, buf, sizeof(buf));
FILE* f = fopen(buf, "w");
if (!f) return;
......
......@@ -1187,8 +1187,8 @@ void CLIENT_STATE::check_project_timeout() {
PROJECT* p = projects[i];
if (p->possibly_backed_off && now > p->min_rpc_time) {
p->possibly_backed_off = false;
char buf[256];
snprintf(buf, sizeof(buf), "Backoff ended for %.128s", p->get_project_name());
char buf[1024];
snprintf(buf, sizeof(buf), "Backoff ended for %s", p->get_project_name());
request_work_fetch(buf);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment