X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=common.c;h=748e5a4639d8580e10beb8c270356e14ad1b6be5;hb=9f3d614e4578bdec2b60d97caec400b28d4af9d3;hp=9cd72bee122dacc6b13248215c0f225bbd7413b3;hpb=d1d7d88a5d0009a9a01f623f887bef2bdc3728d3;p=pciutils.git diff --git a/common.c b/common.c index 9cd72be..748e5a4 100644 --- a/common.c +++ b/common.c @@ -3,14 +3,15 @@ * * Copyright (c) 1997--2016 Martin Mares * - * Can be freely distributed and used under the terms of the GNU GPL. + * Can be freely distributed and used under the terms of the GNU GPL v2+. + * + * SPDX-License-Identifier: GPL-2.0-or-later */ #include #include #include #include -#include #include "pciutils.h" @@ -99,34 +100,34 @@ set_pci_option(struct pci_access *pacc, char *arg) } int -parse_generic_option(int i, struct pci_access *pacc, char *optarg) +parse_generic_option(int i, struct pci_access *pacc, char *arg) { switch (i) { #ifdef PCI_HAVE_PM_INTEL_CONF case 'H': - if (!strcmp(optarg, "1")) + if (!strcmp(arg, "1")) pacc->method = PCI_ACCESS_I386_TYPE1; - else if (!strcmp(optarg, "2")) + else if (!strcmp(arg, "2")) pacc->method = PCI_ACCESS_I386_TYPE2; else - die("Unknown hardware configuration type %s", optarg); + die("Unknown hardware configuration type %s", arg); break; #endif #ifdef PCI_HAVE_PM_DUMP case 'F': - pci_set_param(pacc, "dump.name", optarg); + pci_set_param(pacc, "dump.name", arg); pacc->method = PCI_ACCESS_DUMP; break; #endif case 'A': - set_pci_method(pacc, optarg); + set_pci_method(pacc, arg); break; case 'G': pacc->debugging++; break; case 'O': - set_pci_option(pacc, optarg); + set_pci_option(pacc, arg); break; default: return 0;