mirror of
https://github.com/Brawl345/stargazer.git
synced 2024-11-16 21:29:21 +01:00
Fix compilation on 32 bit-systems
This commit is contained in:
parent
2740aed689
commit
8432bbb684
@ -3,7 +3,6 @@ package stargazer
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
var ErrNoEntries = errors.New("invalid STAR file - no file entries found")
|
||||
@ -19,10 +18,6 @@ type (
|
||||
Filename string
|
||||
}
|
||||
|
||||
ErrFileTooLarge struct {
|
||||
Filename string
|
||||
}
|
||||
|
||||
ErrNotAFile struct {
|
||||
Filename string
|
||||
}
|
||||
@ -40,10 +35,6 @@ func (e ErrFilenameTooLong) Error() string {
|
||||
return fmt.Sprintf("filename '%s' is too long, needs to be < %d characters.", e.Filename, MaxFilenameSize)
|
||||
}
|
||||
|
||||
func (e ErrFileTooLarge) Error() string {
|
||||
return fmt.Sprintf("file '%s' is too large, needs to be < %d bytes.", e.Filename, uint32(math.MaxUint32))
|
||||
}
|
||||
|
||||
func (e ErrNotAFile) Error() string {
|
||||
return fmt.Sprintf("'%s' is not a file.", e.Filename)
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -185,12 +184,6 @@ func NewEntryFromFile(dir string, f string) (*Entry, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(entry.Content) > math.MaxUint32 {
|
||||
return nil, ErrFileTooLarge{
|
||||
Filename: filename,
|
||||
}
|
||||
}
|
||||
|
||||
entry.Header.Filesize = uint32(len(entry.Content))
|
||||
|
||||
entry.Header.Headersize = uint8(1 + 1 + 4 + 1 + 1 + len(entry.Filename))
|
||||
|
Loading…
Reference in New Issue
Block a user