[prev in list] [next in list] [prev in thread] [next in thread] 

List:       erlang-patches
Subject:    [erlang-patches] snmp_pdus.erl patch
From:       mbj () blanked ! org (Martin Bjorklund)
Date:       2008-01-03 10:28:21
Message-ID: 20080103.112821.199451041.mbj () tail-f ! com
[Download RAW message or body]

Hi,

There is a bug in snmp_pdus:enc_oct_str_tag/1.  All the enc_*
functions are supposed to return a flat list, but the second clause of
this function does not.  If it gets a binary it returns a deep list.

Change:

enc_oct_str_tag(OStr) when list(OStr) ->
    lists:append([4|elength(length(OStr))],OStr);
enc_oct_str_tag(OBin) ->
    [4,elength(size(OBin)),OBin].

Into:

enc_oct_str_tag(OStr) when list(OStr) ->
    lists:append([4|elength(length(OStr))],OStr);
enc_oct_str_tag(OBin) ->
    [4|elength(size(OBin))]++binary_to_list(OBin).


/martin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic