It does this, as confirmed on XP (LA) v3.3, and LZ, v4.6. It must be possible to prevent it, or a pack could never be filled because PK$save would try to force an 'FF' beyond the end of the pack!
For anyone wanting to experiment, I suggest using a test ODB-type file on a RAM pack, getting the address of a record in it with FL$frec, then using the address as argument for PK$sadd, and using the record as a buffer, writing length-1 bytes as maximum, to avoid the extra 'FF' corrupting the next record, or causing truncation of the pack. Sticking to this test method will allow all three pack extraction methods (UNMAKE, SendPack, DumpPack) to yield a safe result that you can inspect.
There is no bounty for an answer, but if you find one, you'll have beaten me and Jaap Scherphuis, so gain extensive satisfaction...
EDIT: A FEW POSTS DOWN, THERE IS A PACK IMAGE IN A ZIP FILE. (For repeatable and easy testing). I should have done that for this first post, but better late than never.. The rest of this post will describe what happens so you know in advance of adding unknown pack images to your stuff!
Start with a blank RAM pack, with a MAIN file containing one record, with one field, with a 14 char string in it (guaranteed to be big enough).
Add the following program, translated on a PC to OB3 if building a pack for easily repeatable testing.
Code: Select all
A:
LOCAL M$(12),C%(9)
M$="PK$save Test"
OPEN "B:MAIN",A,A$ :FIRST :CLOSE :rem saves a lot of machine code if you do this first.
C%(1)=$3F2D :rem SWI FL$FREC
C%(2)=$DC41 :rem LDAB 0m
C%(3)=$3F60 :rem SWI PK$SADD
C%(4)=$01CC :rem NOP,LDD Byte count
C%(5)=12 :rem BYTE COUNT
C%(6)=$01CE :rem NOP,LDX Source string
C%(7)=ADDR(M$)+1
C%(8)=$3F61 :rem SWI PK$SAVE
C%(9)=$3900
USR(ADDR(C%()),1)