bug in zero length put

fix issue #1289 bug in zero length put