Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Fixed empty string unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeSapkin committed Jan 18, 2015
1 parent d189f91 commit fdcdfc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/fdb/tuple/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ unittest
cast(ubyte[])[ 0xa0, 0x00, 0x0b ],
"some string",
-1578,
"",
598759847,
-float.min_normal,
double.max,
Expand All @@ -105,6 +106,7 @@ unittest
Part(cast(ubyte[])[ 0xa0, 0x00, 0x0b ]),
Part("some string"),
Part(-1578L),
Part(""),
Part(598759847L),
Part(-float.min_normal),
Part(double.max),
Expand Down
2 changes: 1 addition & 1 deletion source/fdb/tuple/unpacker.d
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private struct FDBVariant
{
auto chars = (cast(char[])slice);
auto size = chars.indexOf(0, 0);
if (size > 0)
if (size > -1)
{
chars = chars[0..size];
_length = size + 1;
Expand Down

0 comments on commit fdcdfc3

Please sign in to comment.