remove dead assignments (#109)

* remove dead assignments

None of them are used.

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>

* The address of an object "&pkgconf_pkg_provides_vermatch_rules[pkgdep->compare]" is never null

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>

* Overrunning array pkgconf_pkg_comparator_names at element index 7

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
pull/116/head
Igor Gnatenko 2017-01-22 20:31:34 +01:00 committed by William Pitcock
parent 5e5c418837
commit 5db87c9685
2 changed files with 1 additions and 6 deletions

View File

@ -208,7 +208,6 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
compare = PKGCONF_CMP_ANY; compare = PKGCONF_CMP_ANY;
package_sz = 0; package_sz = 0;
version_sz = 0;
} }
break; break;
@ -254,7 +253,6 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
cnameptr = cmpname; cnameptr = cmpname;
memset(cmpname, 0, sizeof cmpname); memset(cmpname, 0, sizeof cmpname);
package_sz = 0; package_sz = 0;
version_sz = 0;
} }
if (state == OUTSIDE_MODULE) if (state == OUTSIDE_MODULE)

View File

@ -923,7 +923,7 @@ static const pkgconf_vercmp_res_func_t pkgconf_pkg_comparator_impls[] = {
const char * const char *
pkgconf_pkg_get_comparator(const pkgconf_dependency_t *pkgdep) pkgconf_pkg_get_comparator(const pkgconf_dependency_t *pkgdep)
{ {
if (pkgdep->compare > PKGCONF_ARRAY_SIZE(pkgconf_pkg_comparator_names)) if (pkgdep->compare >= PKGCONF_ARRAY_SIZE(pkgconf_pkg_comparator_names))
return "???"; return "???";
return pkgconf_pkg_comparator_names[pkgdep->compare].name; return pkgconf_pkg_comparator_names[pkgdep->compare].name;
@ -1063,9 +1063,6 @@ pkgconf_pkg_scan_provides_vercmp(const pkgconf_dependency_t *pkgdep, const pkgco
{ {
const pkgconf_pkg_provides_vermatch_rule_t *rule = &pkgconf_pkg_provides_vermatch_rules[pkgdep->compare]; const pkgconf_pkg_provides_vermatch_rule_t *rule = &pkgconf_pkg_provides_vermatch_rules[pkgdep->compare];
if (rule == NULL)
return false;
if (rule->depcmp[provider->compare] != NULL && if (rule->depcmp[provider->compare] != NULL &&
!rule->depcmp[provider->compare](provider->version, pkgdep->version)) !rule->depcmp[provider->compare](provider->version, pkgdep->version))
return false; return false;