Skip to content

Commit

Permalink
Modify the reading processing of the EOF.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsuGitHub committed Aug 7, 2016
1 parent a946e0a commit 3520f62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"io"
"os"

"github.com/small-teton/MpegTsAnalyzer/options"
Expand Down Expand Up @@ -42,7 +43,9 @@ func parseTsFile(filename string, options options.Options) error {
buf := make([]byte, bufSize)
for {
size, err := file.Read(buf)
if err != nil {
if err == io.EOF {
break
} else if err != nil {
return fmt.Errorf("File read error: %s", err)
}
if pos, err = findPat(buf); err != nil {
Expand Down

0 comments on commit 3520f62

Please sign in to comment.