Skip to content

Commit

Permalink
Refactor NUL magic char
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 28, 2025
1 parent 9aab340 commit 5cd730e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
*/
public class CpioArchiveOutputStream extends ArchiveOutputStream<CpioArchiveEntry> implements CpioConstants {

/**
* The NUL character.
*/
private static final char NUL = '\0';

private CpioArchiveEntry entry;

/**
Expand Down Expand Up @@ -379,7 +384,7 @@ private void writeBinaryLong(final long number, final int length, final boolean
*/
private void writeCString(final byte[] str) throws IOException {
out.write(str);
out.write('\0');
out.write(NUL);
count(str.length + 1);
}

Expand Down

0 comments on commit 5cd730e

Please sign in to comment.