mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-24 12:11:33 +00:00
[settings] Fix broken assertion in fetch_string_setting_copy()
Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
This commit is contained in:
parent
1c67623e37
commit
5bd32315d0
@ -448,7 +448,7 @@ int fetch_string_setting_copy ( struct settings *settings,
|
||||
struct setting *setting,
|
||||
char **data ) {
|
||||
int len;
|
||||
int check_len;
|
||||
int check_len = 0;
|
||||
|
||||
len = fetch_setting_len ( settings, setting );
|
||||
if ( len < 0 )
|
||||
@ -458,7 +458,8 @@ int fetch_string_setting_copy ( struct settings *settings,
|
||||
if ( ! *data )
|
||||
return -ENOMEM;
|
||||
|
||||
fetch_string_setting ( settings, setting, *data, ( len + 1 ) );
|
||||
check_len = fetch_string_setting ( settings, setting, *data,
|
||||
( len + 1 ) );
|
||||
assert ( check_len == len );
|
||||
return len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user