mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
audio: Convert use of atoi to qemu_strtoi
If qemu_strtoi indicates an error, return the default value. Signed-off-by: Nia Alarie <nia.alarie@gmail.com> Message-Id: <20180316144047.30904-1-nia.alarie@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
committed by
Gerd Hoffmann
parent
bc753dc09f
commit
441b345313
+1
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user