提交 441b3453 编写于 作者: N Nia Alarie 提交者: Gerd Hoffmann

audio: Convert use of atoi to qemu_strtoi

If qemu_strtoi indicates an error, return the default value.
Signed-off-by: NNia Alarie <nia.alarie@gmail.com>
Message-Id: <20180316144047.30904-1-nia.alarie@gmail.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 bc753dc0
......@@ -335,9 +335,8 @@ static int audio_get_conf_int (const char *key, int defval, int *defaultp)
char *strval;
strval = getenv (key);
if (strval) {
if (strval && !qemu_strtoi(strval, NULL, 10, &val)) {
*defaultp = 0;
val = atoi (strval);
return val;
}
else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册