🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by System Account Sat, 10 Oct 1992 18:22
tar-1.11
#891
Author: System Account
Date: Sat, 10 Oct 1992 18:22
40 lines
1894 bytes
In 'extract.c', line 351 should be

	namelen = strlen(skipcrud + current_file_name) + 1;
							^^^
since we should allocate space for and copy the null terminator
at the end of the string in the bcopy call.

Also, in 'extract.c', line 604 should be

	namelen = strlen(current_file_name + skipcrud) - 1;

instead of

	namelen = strlen(current_file_name) + skipcrud - 1;

I find it rather distracting to have 'skipcrud + current_file_name'
in some places and 'current_file_name + skipcrud' in others.  Since
this occurs so often in this file, why not make it a macro:

	#define CURRENT_FILE_NAME (skipcrud + current_file_name)

and use that instead???

BTW, here's a backtrace of when current_file_name gets clobbered by
extract_archive, as I noted in my previous posting.  I haven't been
able to track down the error yet.  Maybe this would help you...

(gdb) bt
#0  0x41a5b8 in read () at ../read.s:18
#1  0x4068e4 in fl_read () at buffer.c:893
#2  0x406e70 in flush_archive () at buffer.c:1051
#3  0x404f70 in findrec () at buffer.c:179
#4  0x404324 in extract_archive () at extract.c:377
#5  0x40a00c in read_and (do_something=0x403e3c <extract_archive>)
    at list.c:141
#6  0x400320 in main (argc=3, argv=0x7fffbdd4) at tar.c:252

-----------------------------------------------------------------------------
Timothy Fossum -- UW-Parkside -- 900 Wood Road, Box 2000 -- Kenosha, WI 53141
Department of Computer Science and Engineering/fossum@cs.uwp.edu/414-595-2297
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads