Fix compilation on 32 bit-systems

This commit is contained in:
Andreas Bielawski 2022-07-03 17:59:04 +02:00
parent 2740aed689
commit 8432bbb684
Signed by: Brawl
GPG Key ID: 851D5FF3B79056CA
2 changed files with 0 additions and 16 deletions

View File

@ -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)
}

View File

@ -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))