Skip to content
Snippets Groups Projects
Commit ea4f8b4e authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Eliminate a couple more Coverity issues via temporary variables.

This gets the assignment to the rip.* members out of the lock so
Coverity doesn't assume they need to be protected by the lock.

It should compile to the same thing.
parent 8a0384ad
No related branches found
No related tags found
1 merge request!488Overhaul LZH code
Pipeline #7522 passed
......@@ -16232,11 +16232,20 @@ init_rip(struct bbslist *bbs)
rip.default_font_height = 8;
}
else {
/*
* The temp variables here are just to
* silence Coverity which uses the rip.*
* members being set inside the lock as
* an indication that they must be.
*/
pthread_mutex_lock(&vstatlock);
rip.default_font = vstat.forced_font;
rip.default_font_width = vstat.charwidth;
rip.default_font_height = vstat.charheight;
void *tmp_font = vstat.forced_font;
int tmp_width = vstat.charwidth;
int tmp_height = vstat.charheight;
pthread_mutex_unlock(&vstatlock);
rip.default_font = tmp_font;
rip.default_font_width = tmp_width;
rip.default_font_height = tmp_height;
}
 
pending_len = 0;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment