aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorNia Alarie <nia.alarie@gmail.com>2018-03-16 14:40:47 +0000
committerGerd Hoffmann <kraxel@redhat.com>2018-06-25 14:03:30 +0200
commit441b345313f1355fb2464f3b37a07a1ded85b61a (patch)
treefbacfb2e187830522f02473eb0de5a9ba2420e4b /audio/audio.c
parentbc753dc09ff33d99bc9004d7286c50de1d5bece6 (diff)
downloadqemu-441b345313f1355fb2464f3b37a07a1ded85b61a.zip
qemu-441b345313f1355fb2464f3b37a07a1ded85b61a.tar.gz
qemu-441b345313f1355fb2464f3b37a07a1ded85b61a.tar.bz2
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>
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 6eccdb1..d6e9190 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -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 {