diff --git a/ereader.go b/ereader.go index 6d4665f..22582a9 100644 --- a/ereader.go +++ b/ereader.go @@ -696,7 +696,7 @@ func (o *OpenOrder) read(b *bufio.Reader) (err error) { if o.Order.StockRangeUpper, err = readFloat(b); err != nil { return err } - if o.Order.DisplaySize, err = readInt(b); err != nil { + if o.Order.DisplaySize, err = readIntOrDefaultIfEmpty(b, 0); err != nil { return err } if o.Order.BlockOrder, err = readBool(b); err != nil { diff --git a/wire.go b/wire.go index a73c0c3..e6784a7 100644 --- a/wire.go +++ b/wire.go @@ -47,12 +47,16 @@ func readStringList(b *bufio.Reader, sep string) (r []string, err error) { } func readInt(b *bufio.Reader) (int64, error) { + return readIntOrDefaultIfEmpty(b, math.MaxInt64) +} + +func readIntOrDefaultIfEmpty(b *bufio.Reader, defaultIfEmpty int64) (int64, error) { str, err := readString(b) if err != nil { return -1, err } if str == "" { - return math.MaxInt64, nil + return defaultIfEmpty, nil } i, err := strconv.ParseInt(str, 10, 64) return i, err