Skip to content

Commit

Permalink
Print errors to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
scaiper authored and rfjakob committed Sep 5, 2023
1 parent 0f11c77 commit 8b1c4b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gocryptfs-xray/paths_ctlsock.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func transformPaths(socketPath string, req *ctlsock.RequestStruct, in *string, s
errorCount := 0
c, err := ctlsock.New(socketPath)
if err != nil {
fmt.Printf("fatal: %v\n", err)
fmt.Fprintf(os.Stderr, "fatal: %v\n", err)
os.Exit(1)
}
line := 1
Expand Down
4 changes: 2 additions & 2 deletions gocryptfs-xray/xray_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func main() {

s := sum(args.dumpmasterkey, args.decryptPaths, args.encryptPaths)
if s > 1 {
fmt.Printf("fatal: %d operations were requested\n", s)
fmt.Fprintf(os.Stderr, "fatal: %d operations were requested\n", s)
os.Exit(1)
}
if flag.NArg() != 1 {
Expand Down Expand Up @@ -183,7 +183,7 @@ func inspectCiphertext(args *argContainer, fd *os.File) {
fmt.Println("empty file")
os.Exit(0)
} else if err == io.EOF {
fmt.Printf("incomplete file header: read %d bytes, want %d\n", n, contentenc.HeaderLen)
fmt.Fprintf(os.Stderr, "incomplete file header: read %d bytes, want %d\n", n, contentenc.HeaderLen)
os.Exit(1)
} else if err != nil {
errExit(err)
Expand Down

0 comments on commit 8b1c4b0

Please sign in to comment.