Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add bitstring support to cmprint/2

  • Loading branch information...
commit 198959d47cc880893ea53c4aad942fa96c8a3696 1 parent 86446cf
@aerosol aerosol authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/binpp.erl
View
5 src/binpp.erl
@@ -14,7 +14,7 @@
-module(binpp).
-author('Adam Rutkowski adam@mtod.org').
--export([pprint/1, pprint/3]).
+-export([pprint/1]).
-export([cmprint/2]).
-export([from_str/1, from_str/2]).
-export([format/1, format/2]).
@@ -67,7 +67,8 @@ pprint(Bin, Pos, _) ->
-spec cmprint(binary(), binary()) -> ok.
-cmprint(Bin1, Bin2) when is_binary(Bin1), is_binary(Bin2) ->
+cmprint(Bin1, Bin2) when is_binary(Bin1) orelse is_bitstring(Bin1),
+ is_binary(Bin2) orelse is_bitstring(Bin2) ->
{ok, Octets1} = convert(Bin1, hex),
{ok, Octets2} = convert(Bin2, hex),
{ok, {D1, D2}} = diff(Octets1, Octets2),
Please sign in to comment.
Something went wrong with that request. Please try again.