Fix two off-by-ones.
Fix two off-by-ones.

Coverity CID:	1087999, 1011375
Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase