Opened 3 years ago

#13615 new bug

listattr Long Format Listing has Garbage at end of CSTR Attributes

Reported by: AGMS Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/Development
Keywords: listattr Cc: agmsmith@…
Blocked By: Blocking:
Platform: All


If you make a CSTR (C string) attribute of length 9, with no NUL at the end, listattr will show extra junk after the contents when listing it in long format. May want to make your attribute storage buffer 1 byte longer and prefill with zero at the end.

Example, with the attribute contents set to "6589781a4" without the NUL, listattr does know it is 9 characters, but prints 10, leftover probably from listing the previous attribute:

> listattr -l Junk.txt 
File: Junk.txt
        Type       Size  Name                                Contents
 MIME String        11  "BEOS:TYPE"                         text/plain
        Text         9  "DropBoxVersion"                    6589781a4n

20 bytes total in attributes.

Change History (0)

Note: See TracTickets for help on using tickets.