kunt

golang IRC bot
git clone git://git.2f30.org/kunt.git
Log | Files | Refs | LICENSE

commit ca96dc547a1dea7ced8003b6b1062a78455e0997
parent e1c4909c9cdee460a92d6c4b98b5fc2ea293f121
Author: sin <sin@2f30.org>
Date:   Sat Apr 27 13:50:32 +0100

fsdb: Fix issue with dbMap update

Diffstat:
src/fsdb/fsdb.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/fsdb/fsdb.go b/src/fsdb/fsdb.go @@ -70,7 +70,7 @@ func (d *Fsdb) Sync() error { } fmt.Printf("Synced entry (%d, %v)\n", k, v.data) - v.dirty = false + d.dbMap[k] = fsdbVal{false, v.data} } } return nil @@ -152,7 +152,7 @@ func (d *Fsdb) Append(buf []byte) (int, error) { if d.dup(buf) { return -1, fmt.Errorf("Duplicate entry: %s", buf) } - d.dbMap[d.Len()] = fsdbVal{true, buf} + d.dbMap[len(d.dbMap)] = fsdbVal{true, buf} return -1, nil }