mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user