summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-29 10:25:17 +0200
committerNoel Grandin <noel@peralex.com>2016-03-31 11:30:36 +0200
commit6439005484bdf6754b910b1ce025b3fb33b6623f (patch)
tree1a00f48ae11d3da3d928f2d3d68b3e299216328c /setup_native
parent1aa4df615fa5599d05e9dd5e925b5852676185fa (diff)
use SAL_N_ELEMENTS more widely
found using git grep -n 'sizeof.*/.*sizeof.*[0]' Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/source/win32/wintools/makecab/makecab.c2
-rw-r--r--setup_native/source/win32/wintools/msidb/msidb.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/setup_native/source/win32/wintools/makecab/makecab.c b/setup_native/source/win32/wintools/makecab/makecab.c
index 4acdc9fc315d..a5c7acda1a8e 100644
--- a/setup_native/source/win32/wintools/makecab/makecab.c
+++ b/setup_native/source/win32/wintools/makecab/makecab.c
@@ -61,7 +61,7 @@ void cabLogErr(PERF erf, char * msg)
if (erf->erfOper >= 0)
{
- if (erf->erfOper < (sizeof(FCI_ERRS)/sizeof(FCI_ERRS[0])))
+ if (erf->erfOper < SAL_N_ELEMENTS(FCI_ERRS))
cabLog(CABLOG_ERR, "%s: %s", msg, FCI_ERRS[erf->erfOper]);
else
cabLog(CABLOG_ERR, "%s: Unknown error", msg);
diff --git a/setup_native/source/win32/wintools/msidb/msidb.c b/setup_native/source/win32/wintools/msidb/msidb.c
index 733fe58b1205..2c100975fe7b 100644
--- a/setup_native/source/win32/wintools/msidb/msidb.c
+++ b/setup_native/source/win32/wintools/msidb/msidb.c
@@ -441,7 +441,7 @@ static BOOL msidbExportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[])
MSIHANDLE dbhandle, tableListView, rec;
LPWSTR tableFile = 0;
WCHAR tableName[MAX_TABLE_NAME];
- DWORD size = sizeof(tableName) / sizeof(tableName[0]);
+ DWORD size = SAL_N_ELEMENTS(tableName);
int i = 0;
r = MsiOpenDatabaseW(dbfile, (LPCWSTR) MSIDBOPEN_READONLY, &dbhandle);
@@ -456,7 +456,7 @@ static BOOL msidbExportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[])
while (r == ERROR_SUCCESS)
{
- size = sizeof(tableName) / sizeof(tableName[0]);
+ size = SAL_N_ELEMENTS(tableName);
r = MsiRecordGetStringW(rec, 1, tableName, &size);
if (r == ERROR_SUCCESS)
{