rlp: fix handling of single byte zero when decoding into a pointer
A single zero byte carries information and should not set the pointer to nil. This is arguably a corner case. While here, fix the comment to explain pointer reuse.
This commit is contained in:
@ -378,7 +378,7 @@ var decodeTests = []decodeTest{
|
||||
},
|
||||
|
||||
// pointers
|
||||
{input: "00", ptr: new(*uint), value: (*uint)(nil)},
|
||||
{input: "00", ptr: new(*uint), value: uintp(0)},
|
||||
{input: "80", ptr: new(*uint), value: (*uint)(nil)},
|
||||
{input: "C0", ptr: new(*uint), value: (*uint)(nil)},
|
||||
{input: "07", ptr: new(*uint), value: uintp(7)},
|
||||
|
Reference in New Issue
Block a user