Skip to content

Commit 5cd730e

Browse files
committed
Refactor NUL magic char
1 parent 9aab340 commit 5cd730e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
*/
6969
public class CpioArchiveOutputStream extends ArchiveOutputStream<CpioArchiveEntry> implements CpioConstants {
7070

71+
/**
72+
* The NUL character.
73+
*/
74+
private static final char NUL = '\0';
75+
7176
private CpioArchiveEntry entry;
7277

7378
/**
@@ -379,7 +384,7 @@ private void writeBinaryLong(final long number, final int length, final boolean
379384
*/
380385
private void writeCString(final byte[] str) throws IOException {
381386
out.write(str);
382-
out.write('\0');
387+
out.write(NUL);
383388
count(str.length + 1);
384389
}
385390

0 commit comments

Comments
 (0)