aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/lawl/pulseaudio/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/lawl/pulseaudio/format.go')
-rw-r--r--vendor/github.com/lawl/pulseaudio/format.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/github.com/lawl/pulseaudio/format.go b/vendor/github.com/lawl/pulseaudio/format.go
index f1e7503..51b52c8 100644
--- a/vendor/github.com/lawl/pulseaudio/format.go
+++ b/vendor/github.com/lawl/pulseaudio/format.go
@@ -156,13 +156,15 @@ func bread(r io.Reader, data ...interface{}) error {
sptr, ok := v.(*string)
if ok {
- buf := make([]byte, 1024) // max string length i guess.
+ buf := make([]byte, 0)
i := 0
for {
- _, err := r.Read(buf[i : i+1])
+ var curChar [1]byte
+ _, err := r.Read(curChar[:])
if err != nil {
return err
}
+ buf = append(buf, curChar[0])
if buf[i] == 0 {
*sptr = string(buf[:i])
break