]> git.seodisparate.com - SimpleArchiver/commitdiff
Update file_format.md
authorStephen Seo <seo.disparate@gmail.com>
Thu, 4 Jul 2024 04:48:39 +0000 (13:48 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 4 Jul 2024 04:48:39 +0000 (13:48 +0900)
Make strings NULL-terminated.

file_format.md

index 909891dce57a57c030ba6a835071b2a765fa96f7..5fda53b4d6adc56c0867ccbd8927cc9268d689eb 100644 (file)
@@ -22,18 +22,24 @@ ignored.
 If the previous "de/compressor is set" flag is enabled, then the next section is
 added:
 
-1. 2 bytes is 16-bit unsigned integer "compressor cmd+args" in big-endian.
-2. X bytes of "compressor cmd+args" (length defined by previous value).
+1. 2 bytes is 16-bit unsigned integer "compressor cmd+args" in big-endian. This
+   does not include the NULL at the end of the string.
+2. X bytes of "compressor cmd+args" (length defined by previous value). Is a
+   NULL-terminated string.
 3. 2 bytes is 16-bit unsigned integer "decompressor cmd+args" in big-endian.
-4. X bytes of "decompressor cmd+args" (length defined by previous value).
+   This does not include the NULL at the end of the string.
+4. X bytes of "decompressor cmd+args" (length defined by previous value). Is a
+   NULL-terminated string.
 
 The next 4 bytes is 32-bit unsigned integer "file count" in big-endian which
 will indicate the number of files in this archive.
 
 Following the file-count bytes, the following bytes are added for each file:
 
-1. 2 bytes is 16-bit unsigned integer "filename length" in big-endian.
-2. X bytes of filename (length defined by previous value).
+1. 2 bytes is 16-bit unsigned integer "filename length" in big-endian. This does
+   not include the NULL at the end of the string.
+2. X bytes of filename (length defined by previous value). Is a NULL-terminated
+   string.
 3. 4 bytes bit-flags
     1. The first byte
         1. The first bit is set if the file is a symbolic link.
@@ -44,8 +50,10 @@ Following the file-count bytes, the following bytes are added for each file:
     4. The fourth byte.
         1. Currently unused.
 4. If this file is a symbolic link:
-    1. 2 bytes is 16-bit unsigned integer "link target path" in big-endian.
-    2. X bytes of link-target-path (length defined by previous value).
+    1. 2 bytes is 16-bit unsigned integer "link target path" in big-endian. This
+       does not include the NULL at the end of the string.
+    2. X bytes of link-target-path (length defined by previous value). Is a
+       NULL-terminated string.
 5. If this file is NOT a symbolic link:
     1. 8 bytes 64-bit unsigned integer "size of filename in this archive file".
     2. X bytes file data (length defined by previous value).