[devel] [PATCH for apt 06/38] Get rid of hardcoded array size
Aleksei Nikiforov
darktemplar на altlinux.org
Вт Дек 10 18:23:11 MSK 2019
Found via cppcheck
---
apt/apt-pkg/srcrecords.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apt/apt-pkg/srcrecords.cc b/apt/apt-pkg/srcrecords.cc
index 00e4f3c..35b89ee 100644
--- a/apt/apt-pkg/srcrecords.cc
+++ b/apt/apt-pkg/srcrecords.cc
@@ -145,7 +145,7 @@ const char *pkgSrcRecords::Parser::BuildDepType(unsigned char Type)
"Build-Depends-Indep",
"Build-Conflicts",
"Build-Conflicts-Indep"};
- if (Type < 4)
+ if (Type < sizeof(fields)/sizeof(*fields))
return fields[Type];
else
return "";
--
2.24.0
Подробная информация о списке рассылки Devel