Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Muller committed Feb 10, 2015
1 parent b1cc05f commit 06b4277
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rfc6587_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestBadSplit(t *testing.T) {
if err := scanner.Err(); err == nil {
t.Error("Expected an error, but didn't get one")
} else {
t.Log("Error: ", err)
t.Log("Error was: ", err)
}

}
5 changes: 3 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ func rfc6587ScannerSplit(data []byte, atEOF bool) (advance int, token []byte, er
if err != nil {
return 0, nil, err
}
if len(data) >= length+i+1 {
end := length + i + 1
if len(data) >= end {
//Return the frame with the length removed
return length + i + 1, data[i+1 : length+i+1], nil
return end, data[i+1 : end], nil
}
}

Expand Down

0 comments on commit 06b4277

Please sign in to comment.