diff options
author | Siri Hansen <[email protected]> | 2017-10-17 19:23:58 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-10-24 14:38:39 +0200 |
commit | 24c79977c7974d5415b6d4f7085a651ce1048e6a (patch) | |
tree | 70a8f069dab6750af446cc1bab071047c060f4b1 /lib/observer/src/cdv_bin_cb.erl | |
parent | 541ee20b9eaefed7802f08cecddfbd12e5f3b516 (diff) | |
download | otp-24c79977c7974d5415b6d4f7085a651ce1048e6a.tar.gz otp-24c79977c7974d5415b6d4f7085a651ce1048e6a.tar.bz2 otp-24c79977c7974d5415b6d4f7085a651ce1048e6a.zip |
[observer] Don't crash on empty binary
Commit e1310b8f introduced a bug which caused the observer tool (and
crashdump_viewer) to crash when trying to display an empty binary. The
same change would also cause leading zeros in a binary to disappear in
the preview. The bug is now corrected.
Diffstat (limited to 'lib/observer/src/cdv_bin_cb.erl')
-rw-r--r-- | lib/observer/src/cdv_bin_cb.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/observer/src/cdv_bin_cb.erl b/lib/observer/src/cdv_bin_cb.erl index 5502869973..a4a542297c 100644 --- a/lib/observer/src/cdv_bin_cb.erl +++ b/lib/observer/src/cdv_bin_cb.erl @@ -71,6 +71,8 @@ hex_binary_fun(Bin) -> plain_html(io_lib:format("~s",[S])) end. +format_hex(<<>>,_) -> + []; format_hex(<<B1:4,B2:4>>,_) -> [integer_to_list(B1,16),integer_to_list(B2,16)]; format_hex(<<B1:4,B2:4,Bin/binary>>,0) -> |