Wireshark-commits: [Wireshark-commits] master 3d570b5: Fix handling of the magic number.
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 23 Jan 2016 00:41:26 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=3d570b5a39f868209e4b38c43b0ba6bfefe8a9bf
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

3d570b5 by Guy Harris (guy@xxxxxxxxxxxx):

    Fix handling of the magic number.
    
    Just treat it as an array of bytes.  When checking for whether it's a
    pcap file, also determine whether it's big-endian or little-endian.
    Note that reading it in *host* byte order will tell you whether it's in
    your byte order or byte-swapped; you have to know your byte order to
    know whether that means little-endian or big-endian.
    
    Have a #define for the magic number size, as all magic number values
    must be that size, and use that as the size of the magic-number arrays.
    
    Handle nanosecond timestamp resolution while we're at it.
    
    Change-Id: I4d83579d919ae9f15888afca14317631d413ca51
    Reviewed-on: https://code.wireshark.org/review/13490
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  9b8f526   That warning is bogus; squelch it with an otherwise-unnecessary cast.
    adds  3d570b5   Fix handling of the magic number.


Summary of changes:
 epan/dissectors/file-pcap.c |   67 ++++++++++++++++++++++++++++---------------
 1 file changed, 44 insertions(+), 23 deletions(-)