提交 c5972df7 编写于 作者: J Ján Tomko

vboxDumpDisplay: remove suspicious strlen

The return type of strlen is 'size_t', which is unsigned and therefore
never less than zero.

Use STREQ to make the check obvious.
上级 5a161974
...@@ -3336,7 +3336,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine) ...@@ -3336,7 +3336,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
VBOX_UTF16_TO_UTF8(valueDisplayUtf16, &valueDisplayUtf8); VBOX_UTF16_TO_UTF8(valueDisplayUtf16, &valueDisplayUtf8);
VBOX_UTF16_FREE(valueDisplayUtf16); VBOX_UTF16_FREE(valueDisplayUtf16);
if (strlen(valueDisplayUtf8) <= 0) if (STREQ(valueDisplayUtf8, ""))
VBOX_UTF8_FREE(valueDisplayUtf8); VBOX_UTF8_FREE(valueDisplayUtf8);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册