<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- lib/archive.c
+++ lib/archive.c
@@ -387,7 +387,8 @@
 			return NULL;
 		}
         
-		XAR(ret)-&gt;heap_offset = xar_get_heap_offset(ret) + offset;
+		XAR(ret)-&gt;heap_offset =
+			XAR(ret)-&gt;toc_count + sizeof(xar_header_t) + offset;
 		if( lseek(XAR(ret)-&gt;fd, XAR(ret)-&gt;heap_offset, SEEK_SET) == -1 ) {
 			xar_close(ret);
 			return NULL;
--- src/xar.c
+++ src/xar.c
@@ -783,7 +783,7 @@
 int main(int argc, char *argv[]) {
 	int ret;
 	char *filename = NULL;
-	char command = 0, c;
+	signed char command = 0, c;
 	char **args;
 	const char *tocfile = NULL;
 	int arglen, i, err;
</pre></body></html>