Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 23761: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-ms-mms.c

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 05 Dec 2007 02:49:00 -0800

Martin Mathieson wrote:

Does this mean that the %3s will copy 3 characters into the protocol name buffer followed by an extra NULL terminator?

That's how I read the man page:

$ man sscanf

	...


In addition to these flags, there may be an optional maximum field width, expressed as a decimal integer, between the % and the conversion. If no
     width is given, a default of ``infinity'' is used (with one exception,
below); otherwise at most this many bytes are scanned in processing the
     conversion.  In the case of the lc, ls and l[ conversions, the field
width specifies the maximum number of multibyte characters that will be
     scanned.  Before conversion begins, most conversions skip white space;
     this white space is not counted against the field width.

     The following conversions are available:

		...

s Matches a sequence of non-white-space characters; the next pointer
           must be a pointer to char, and the array must be large enough to
           accept all the sequence and the terminating NUL character.  The
           input string stops at white space or at the maximum field width,
           whichever occurs first.

  • References:
    • Re: [Wireshark-dev] [Wireshark-commits] rev 23761: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-ms-mms.c
      • From: Martin Mathieson
  • Prev by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 23761: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-ms-mms.c
  • Next by Date: [Wireshark-dev] Fwd: GTK+ 2.12.3 released
  • Previous by thread: Re: [Wireshark-dev] [Wireshark-commits] rev 23761: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-ms-mms.c
  • Next by thread: [Wireshark-dev] Fwd: GTK+ 2.12.3 released
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation