From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:59824 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932185Ab0JJKoO (ORCPT ); Sun, 10 Oct 2010 06:44:14 -0400 Subject: Re: [PATCH 3/3] staging: brcm80211: fix to use "%pM" flag to print MAC address From: Johannes Berg To: Andy Shevchenko Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nohee Ko , Greg Kroah-Hartman In-Reply-To: References: <86dfcd5dfdee8ce5ca558634d4606922f05e96e1.1286705921.git.andy.shevchenko@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Sun, 10 Oct 2010 12:44:10 +0200 Message-ID: <1286707450.3547.8.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: 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