Skip to content

[Bug] --zero concatenates entries instead of writing NUL separators #333

Description

@equationzhao

Describe the bug
--zero is documented as ending each output line with NUL. It currently concatenates entries without any delimiter.

To Reproduce

  1. Build the current repository:
go build -o /tmp/g-bug-audit .
  1. Create two files:
tmp=$(mktemp -d)
touch "$tmp/a" "$tmp/b"
  1. Inspect the output bytes:
/tmp/g-bug-audit --no-config --disable-index --classic -A --zero "$tmp" | od -An -tx1c
printf 'exit=%s tmp=%s\n' ${pipestatus[1]:-${PIPESTATUS[0]}} "$tmp"
  1. Actual output:
           61  62
           a   b

exit=0 tmp=/var/folders/1b/57vdxmgj7s1glqm6tbsw1frm0000gn/T/tmp.o9IEbAMyXW
  1. Expected output: the byte stream should contain 61 00 62 00 or at least a NUL after each entry.

Screenshots
Not applicable.

Info (please complete the following information):

  • OS: macOS darwin/arm64
  • Version: v0.31.2, Go go1.26.1

Additional context
The zero-output printer appears to write each entry's content but never writes \x00.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions