Fix 'length'

Because 'argv[argc]' is specified to be a null pointer, 'length' works
for 'argv'. It does, however, fail on general string arrays. Fix this
by passing the array length to the procedure and using it to terminate
the loop.