tools: reduce variable scope
tools: reduce variable scope

Move the variables into the blocks were they are used.
This fixes cppcheck warnings:
	[tools/cli-validator.c:67]: (style) The scope of the variable
	'inputLength' can be reduced.
	[tools/cli-validator.c:92]: (style) The scope of the variable 'spaces'
	can be reduced.

rtrlib/rtrlib,rtrlib/rtrlib,rtrlib/rtrlib