Skip to content

Commit

Permalink
src/winusb: util_check_function_parameters_quantity: make error messa…
Browse files Browse the repository at this point in the history
…ge red

Signed-off-by: 林博仁 <[email protected]>
  • Loading branch information
brlin-tw committed Jun 8, 2017
1 parent b598e55 commit e207820
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/winusb
Original file line number Diff line number Diff line change
Expand Up @@ -1143,12 +1143,14 @@ util_check_function_parameters_quantity(){
local -i given_parameter_quantity="${1}"

if [ "${given_parameter_quantity}" -ne "${expected_parameter_quantity}" ]; then
switch_terminal_text_color red
printf --\
"%s: FATAL: Function requires %u parameters, but %u is given\n"\
"${FUNCNAME[1]}"\
"${expected_parameter_quantity}"\
"${given_parameter_quantity}"\
1>&2
switch_terminal_text_color none
exit 1
fi
return 0
Expand Down

0 comments on commit e207820

Please sign in to comment.