Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  snmp_pdus.erl patch

Guest
Posted: Thu Jan 03, 2008 10:28 am Reply with quote
Guest
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
_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum