mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
Silence coverity CHECKED_RETURN writing benc strs
saveStringFunc() gets the target string by calling tr_variantGetStr(). It previously didn't check to see if this function succeeded because saveStringFunc() isn't reached without the type already being known. However, checking the return value costs nothing and makes Coverity happy.
This commit is contained in:
parent
f79e22fb90
commit
33e2ece7e5
1 changed files with 5 additions and 3 deletions
|
@ -351,9 +351,11 @@ static void saveStringFunc(tr_variant const* v, void* evbuf)
|
|||
{
|
||||
size_t len;
|
||||
char const* str;
|
||||
tr_variantGetStr(v, &str, &len);
|
||||
evbuffer_add_printf(evbuf, "%zu:", len);
|
||||
evbuffer_add(evbuf, str, len);
|
||||
if (tr_variantGetStr(v, &str, &len))
|
||||
{
|
||||
evbuffer_add_printf(evbuf, "%zu:", len);
|
||||
evbuffer_add(evbuf, str, len);
|
||||
}
|
||||
}
|
||||
|
||||
static void saveDictBeginFunc(tr_variant const* val UNUSED, void* evbuf)
|
||||
|
|
Loading…
Add table
Reference in a new issue