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:
		
							parent
							
								
									bc753dc09f
								
							
						
					
					
						commit
						441b345313
					
				@ -335,9 +335,8 @@ static int audio_get_conf_int (const char *key, int defval, int *defaultp)
 | 
				
			|||||||
    char *strval;
 | 
					    char *strval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    strval = getenv (key);
 | 
					    strval = getenv (key);
 | 
				
			||||||
    if (strval) {
 | 
					    if (strval && !qemu_strtoi(strval, NULL, 10, &val)) {
 | 
				
			||||||
        *defaultp = 0;
 | 
					        *defaultp = 0;
 | 
				
			||||||
        val = atoi (strval);
 | 
					 | 
				
			||||||
        return val;
 | 
					        return val;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user