I don't know if this useful, but I like to pipe strange characters into hexdump
echo "This is a test" | ./compress | hexdump -c Printf and gdb are powerful debugging tools. On Tue, Apr 23, 2002 at 04:17:42PM -0500, Robert Giles wrote: > Howdy folks - I'm writing a program to compress and uncompress a string > and keep getting weird results... for a string of length 0-6, uncompress > stores garbage at the end of the string. Length = 7, output is OK. > Length 8,9,10,11 - output is corrupted. Length = 12, output is OK. > > Program takes input on STDIN, compresses it into a temporary buffer and > then uncompress *that* buffer into another temporary buffer, printing the > result after compress/uncompress (so I can compare to the original): > ---- > > penguin3:~/linux-client$ echo "This is a test" | ./compress > This is a test > penguin3:~/linux-client$ echo "This is a test 123" | ./compress > This is a test 123 > @penguin3:~/linux-client$ echo "This is a test ABC" | ./compress > This is a test ABC > @penguin3:~/linux-client$ > > (the @ symbol actually contains 5 characters of garbage, but I can't > paste them into Pine because it thinks they're commands) > > It also seems that the garbage introduced at the end remains constant for > a given input string length (regardless of the content of the string). > > Any zlib experts out there have an idea on what might be going wrong? > (I'll e-mail the source if anyone wants to take a look) > > TIA > > .............................................................. > Robert Giles UT CS > [EMAIL PROTECTED] http://www.daihatsu.org/ > > > _______________________________________________ > Siglinux mailing list > [EMAIL PROTECTED] > http://www.utacm.org/mailman/listinfo/siglinux > -- 28 70 20 71 2C 65 29 61 9C B1 36 3D D4 69 CE 62 4A 22 8B 0E DC 3E mailto:[EMAIL PROTECTED] http://thecap.org/ _______________________________________________ Siglinux mailing list [EMAIL PROTECTED] http://www.utacm.org/mailman/listinfo/siglinux
