mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
Fixed closing zlib decompressor in error case. Added missing header.
This commit is contained in:
parent
0ff87c1d22
commit
26aabeb6d5
@ -61,10 +61,11 @@ func NewDecodedBlock(data []byte, nameIndex map[string]int) (db *DecodedBlock, e
|
||||
}
|
||||
|
||||
var mapContent []byte
|
||||
if mapContent, err = ioutil.ReadAll(zr); err != nil {
|
||||
mapContent, err = ioutil.ReadAll(zr)
|
||||
zr.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
zr.Close()
|
||||
|
||||
if uncompressedLen != len(mapContent) {
|
||||
err = ErrMapContentSizeMismatch
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright 2014 by Sascha L. Teichmann
|
||||
// Use of this source code is governed by the MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -83,6 +83,7 @@ func main() {
|
||||
fmt.Printf("num of blocks: %d\n", numBlocks)
|
||||
fmt.Printf("num of bytes: %d\n", bytesTotal)
|
||||
|
||||
fmt.Println("uses block versions:")
|
||||
for version, count := range versions {
|
||||
fmt.Printf("%d: %d\n", version, count)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user