Changeset 21ab138 for lib/trace.c


Ignore:
Timestamp:
06/27/07 19:43:03 (14 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
0c47bf4
Parents:
954a329
Message:

Fix trace_ether_ntoa(). make "staticbuf" actually static.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r7c72e4d r21ab138  
    14431443DLLEXPORT char *trace_ether_ntoa(const uint8_t *addr, char *buf)
    14441444{
    1445         char *buf2 = buf;
    1446         char staticbuf[18]={0,};
    1447         if (!buf2)
    1448                 buf2=staticbuf;
    1449         snprintf(buf2,(size_t)18,"%02x:%02x:%02x:%02x:%02x:%02x",
     1445        static char staticbuf[18]={0,};
     1446        if (!buf)
     1447                buf=staticbuf;
     1448        snprintf(buf,(size_t)18,"%02x:%02x:%02x:%02x:%02x:%02x",
    14501449                        addr[0],addr[1],addr[2],
    14511450                        addr[3],addr[4],addr[5]);
    1452         return buf2;
     1451        return buf;
    14531452}
    14541453
Note: See TracChangeset for help on using the changeset viewer.