diff --git a/shell/e.cpp b/shell/e.cpp index ce4e31c..9bc3c6c 100644 --- a/shell/e.cpp +++ b/shell/e.cpp @@ -49,14 +49,15 @@ static _e_args parse_e(Session &session, Parser &parser) void _e(Session &, std::string, std::vector const &values) { for(long value: values) { + long print_val = labs(value); + /* Hexa format */ - int length = (labs(value) <= (1ll << 32) ? 8 : 16) + 2 + (value < 0); + int length = (print_val <= (1ll << 32) ? 8 : 16) + 2 + (value < 0); std::string format = fmt::format("{{:#0{}x}}", length); fmt::print(format, value); - long a = abs(value); - if(a <= 100 || a % 100 <= 1 || a % 100 >= 99) - fmt::print(" = {}", a); + if(print_val <= 100 || print_val % 100 <= 1 || print_val % 100 >= 99) + fmt::print(" = {}", print_val); fmt::print("\n"); }