[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 10 Oct 2010 12:44:10 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-wireless@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, Nohee Ko <noheek@...adcom.com>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH 3/3] staging: brcm80211: fix to use "%pM" flag to print
MAC address
On Sun, 2010-10-10 at 13:20 +0300, Andy Shevchenko wrote:
> char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf)
> {
> - static const char template[] = "%02x:%02x:%02x:%02x:%02x:%02x";
> - snprintf(buf, 18, template,
> - ea->octet[0] & 0xff, ea->octet[1] & 0xff, ea->octet[2] & 0xff,
> - ea->octet[3] & 0xff, ea->octet[4] & 0xff, ea->octet[5] & 0xff);
> + snprintf(buf, 18, "%pM", ea->octet);
That's a pretty strange use of snprintf -- just use sprintf if you don't
have a real buffer length.
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists