[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/6] audio: Convert use of atoi to qemu_strtoi
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 6/6] audio: Convert use of atoi to qemu_strtoi |
Date: |
Mon, 25 Jun 2018 15:12:53 +0200 |
From: Nia Alarie <address@hidden>
If qemu_strtoi indicates an error, return the default value.
Signed-off-by: Nia Alarie <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
audio/audio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index 6eccdb17ee..d6e91901aa 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 {
--
2.9.3
Re: [Qemu-devel] [PULL 1/6] audio/hda: create millisecond timers that handle IO, Peter Maydell, 2018/06/29
[Qemu-devel] [PULL 4/6] audio/hda: detect output buffer overruns, Gerd Hoffmann, 2018/06/25
[Qemu-devel] [PULL 5/6] audio/hda: enable new timer code by default., Gerd Hoffmann, 2018/06/25
[Qemu-devel] [PULL 6/6] audio: Convert use of atoi to qemu_strtoi,
Gerd Hoffmann <=
Re: [Qemu-devel] [PULL 0/6] Audio 20180625 patches, Peter Maydell, 2018/06/25