API: don't return error if trickle-up message is empty

This commit is contained in:
David Anderson 2014-07-28 08:58:02 -07:00
parent 5cec137320
commit 60140836b6
1 changed files with 4 additions and 1 deletions

View File

@ -1358,7 +1358,10 @@ int boinc_send_trickle_up(char* variety, char* p) {
FILE* f = boinc_fopen(TRICKLE_UP_FILENAME, "wb");
if (!f) return ERR_FOPEN;
fprintf(f, "<variety>%s</variety>\n", variety);
size_t n = fwrite(p, strlen(p), 1, f);
size_t n = 1;
if (strlen(p)) {
n = fwrite(p, strlen(p), 1, f);
}
fclose(f);
if (n != 1) return ERR_WRITE;
have_new_trickle_up = true;