commit f583b2d142a260f4b4509bfe15564b5ab83ebfaf
parent 63d46d46917273ae2ec5c3f2bbe415c207843579
Author: sin <sin@2f30.org>
Date: Tue, 30 Apr 2013 14:50:28 +0100
check NewCipher for errors, die within mapfs for now
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mapfs/mapfs.go b/src/mapfs/mapfs.go
@@ -5,6 +5,7 @@ import (
"bytes"
"code.google.com/p/go.crypto/blowfish"
"fmt"
+ "log"
"math/rand"
"os"
"path"
@@ -54,6 +55,7 @@ func MakeMapIter(m *Mapfs) MapIter {
}
func NewMapfs(name string, path string, prefix string) *Mapfs {
+ log.SetPrefix("mapfs: ")
return &Mapfs{
name: name,
path: path,
@@ -66,7 +68,11 @@ func NewMapfs(name string, path string, prefix string) *Mapfs {
}
func NewEncryptedMapfs(name string, path string, prefix string, key string) *Mapfs {
- c, _ := blowfish.NewCipher([]byte(key))
+ log.SetPrefix("mapfs: ")
+ c, err := blowfish.NewCipher([]byte(key))
+ if err != nil {
+ log.Fatal(err)
+ }
return &Mapfs{
name: name,
path: path,