Allocating 0-length buffers

It's convenient to allow 0-size buffers to be allocated to
avoid special-cases elsewhere in the code.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #2 from djs55/fixes

Allocating 0-length buffers