[haiku-bugs] [Haiku] #13615: listattr Long Format Listing has Garbage at end of CSTR Attributes

  • From: "AGMS" <trac@xxxxxxxxxxxx>
  • Date: Thu, 20 Jul 2017 15:31:18 -0000

#13615: listattr Long Format Listing has Garbage at end of CSTR Attributes
---------------------------------------------+-----------------------------
 Reporter:  AGMS                             |        Owner:  nobody
     Type:  bug                              |       Status:  new
 Priority:  normal                           |    Milestone:  Unscheduled
Component:  Applications/Command Line Tools  |      Version:
                                             |  R1/Development
 Keywords:  listattr                         |   Blocked By:
 Blocking:                                   |  Has a Patch:  0
 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.
 }}}

--
Ticket URL: <https://dev.haiku-os.org/ticket/13615>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts:

  • » [haiku-bugs] [Haiku] #13615: listattr Long Format Listing has Garbage at end of CSTR Attributes - AGMS