mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-24 17:20: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
|
var mapContent []byte
|
||||||
if mapContent, err = ioutil.ReadAll(zr); err != nil {
|
mapContent, err = ioutil.ReadAll(zr)
|
||||||
|
zr.Close()
|
||||||
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
zr.Close()
|
|
||||||
|
|
||||||
if uncompressedLen != len(mapContent) {
|
if uncompressedLen != len(mapContent) {
|
||||||
err = ErrMapContentSizeMismatch
|
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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -83,6 +83,7 @@ func main() {
|
|||||||
fmt.Printf("num of blocks: %d\n", numBlocks)
|
fmt.Printf("num of blocks: %d\n", numBlocks)
|
||||||
fmt.Printf("num of bytes: %d\n", bytesTotal)
|
fmt.Printf("num of bytes: %d\n", bytesTotal)
|
||||||
|
|
||||||
|
fmt.Println("uses block versions:")
|
||||||
for version, count := range versions {
|
for version, count := range versions {
|
||||||
fmt.Printf("%d: %d\n", version, count)
|
fmt.Printf("%d: %d\n", version, count)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user