Improve exceed length limit error message

The error message printed when username or password length exceeds the
limit uses a hex value without 0x prefix, which is really confusing in
some cases. This patch changes them to decimal format. Also use removes
extra strlen calls as they are of O(1) complexity.

Tested:
Update an ipmi user with a 22-char password, 22 is logged instead of 16

Change-Id: Idec08d920c6377d4db9af7dd616c73f618a1e839
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2 files changed