Qt: Fix importProfilesFromDir() semantics

The default value for skippedCnt is Q_NULLPTR. Do not dereference
skippedCnt unconditionally.

Change-Id: Ice33a7f9034507f39f16406cc365f39f4e543da5
Reviewed-on: https://code.wireshark.org/review/34271
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Tomasz Moń 2019-08-13 15:19:04 +02:00 committed by Stig Bjørlykke
parent 83bdc68c96
commit 9784b1dda1
1 changed files with 3 additions and 2 deletions

View File

@ -1129,7 +1129,7 @@ int ProfileModel::importProfilesFromDir(QString dirname, int * skippedCnt, bool
QDir profileDir(gchar_free_to_qstring(get_profiles_dir()));
QDir dir(dirname);
if ( *skippedCnt)
if ( skippedCnt )
*skippedCnt = 0;
if ( dir.exists() )
@ -1178,7 +1178,8 @@ int ProfileModel::importProfilesFromDir(QString dirname, int * skippedCnt, bool
loadProfiles();
}
*skippedCnt = skipped;
if ( skippedCnt )
*skippedCnt = skipped;
return count;
}