peci_cmds: allow a larger write length for AW FCS

The AW FCS byte is included in the write length but is calculated
by the driver, so it's not part of the user data.  This change
allows the correct write length to be sent in a raw command without
providing a dummy byte for the AW FCS.

Tested:
peci_cmds raw 0x30 0x11 0x1 0xc5 0 3 0 0 0 4 0 0 0 0 0 0 0 0 0 -v
PECI target[0x30]: Raw command: 30 11 01 0xc5 0x00 0x03 0x00 0x00 0x00
0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Raw response: 0x40
   0x40

Change-Id: I01668e7709c3b248ce2e98fc8e061e316a5b3097
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/peci_cmds.c b/peci_cmds.c
index e789ca3..1e83ef0 100644
--- a/peci_cmds.c
+++ b/peci_cmds.c
@@ -644,8 +644,8 @@
         // Read length is provided in the third byte of the PECI command
         uint8_t readLength = (uint8_t)strtoul(argv[optind++], NULL, 0);
 
-        // remaining parameters should match write length
-        if ((argc - optind) != writeLength)
+        // remaining parameters should fit within write length
+        if ((argc - optind) > writeLength)
         {
             printf("ERROR: Incorrect write length for raw command\n");
             goto ErrorExit;
@@ -657,7 +657,7 @@
             printf("Raw command memory allocation failed\n");
             return 1;
         }
-        for (i = 0; i < writeLength; i++)
+        for (i = 0; i < (argc - optind); i++)
         {
             rawCmd[i] = (uint8_t)strtoul(argv[i + optind], NULL, 0);
         }