mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Make _alpm_filelist_contains() NULL-safe
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
a33424f879
commit
bf84dc4cf1
@ -318,12 +318,16 @@ const alpm_file_t *_alpm_filelist_contains(alpm_filelist_t *filelist,
|
||||
const char *name)
|
||||
{
|
||||
size_t i;
|
||||
const alpm_file_t *file = filelist->files;
|
||||
for(i = 0; i < filelist->count; i++) {
|
||||
const alpm_file_t *file;
|
||||
|
||||
if(!filelist) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(file = filelist->files, i = 0; i < filelist->count; file++, i++) {
|
||||
if(strcmp(file->name, name) == 0) {
|
||||
return file;
|
||||
}
|
||||
file++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user