Ensure ejabberdctl status result is in valid shell supported range

This commit is contained in:
Mickael Remond 2016-07-30 13:18:39 +02:00
parent 39640b67c7
commit 19ad6e6145
No known key found for this signature in database
GPG Key ID: E6F6045D79965AA3
1 changed files with 2 additions and 1 deletions

View File

@ -439,7 +439,8 @@ format_result(404, {_Name, _}) ->
make_status(ok) -> ?STATUS_SUCCESS;
make_status(true) -> ?STATUS_SUCCESS;
make_status(Code) when is_integer(Code) -> Code;
make_status(Code) when is_integer(Code), Code > 255 -> ?STATUS_ERROR;
make_status(Code) when is_integer(Code), Code > 0 -> Code;
make_status(_Error) -> ?STATUS_ERROR.
get_list_commands(Version) ->