Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal packet-ieee80211.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 24 Sep 2001 21:21:16 -0500 (CDT)
guy         2001/09/24 21:21:15 CDT

  Modified files:
    .                    packet-ieee80211.c 
  Log:
  If "snprintf()" can't print all the data because there's not enough
  room, it might return -1 in some versions of glibc; check for that, and
  quit if that happens.
  
  It might also return the number of characters that would've been printed
  had there been enough room; this means that a loop that does
  
  	n += snprintf (buf + n, BUF_LENGTH - n, ...);
  
  may end up making "n" bigger than BUF_LENGTH, and "snprintf()" might not
  sanely handle being passed a negative length, so if "n" isn't less than
  the total length of the string buffer, don't add stuff to it.
  
  Revision  Changes    Path
  1.40      +12 -5     ethereal/packet-ieee80211.c