lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3vJx6YBB2qRD8R9@smile.fi.intel.com>
Date:   Mon, 21 Nov 2022 20:56:07 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Gerald Loacker <gerald.loacker@...fvision.net>
Cc:     linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Nikita Yushchenko <nikita.yoush@...entembedded.com>,
        Jakob Hauser <jahau@...ketmail.com>,
        Michael Riesch <michael.riesch@...fvision.net>
Subject: Re: [PATCH v2 2/2] iio: magnetometer: add ti tmag5273 driver

On Mon, Nov 21, 2022 at 08:40:53PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 21, 2022 at 06:24:18PM +0100, Gerald Loacker wrote:
> > Am 21.11.2022 um 15:04 schrieb Andy Shevchenko:
> > > On Mon, Nov 21, 2022 at 01:35:42PM +0100, Gerald Loacker wrote:

...

> > >> +		snprintf(data->name, sizeof(data->name), "tmag5273x%1u",
> > > 
> > > There is a difference between %1u and %.1u. And I believe you wanted the
> > > latter, but...
> > 
> > %1u works fine for me. Can you point me to the documentation for %.1u?
> 
> man printf(3)
> 
> It was a surprise to me that many developers don't know the difference here.
> The %NNNNu defines the _minimum_ digits to print, while the %.NNNu defines
> the _exact_ amount of digits to print (NNN -- a number).
> 
> > >> +			 data->version);

Even me trapped to this one more time :-)

The above is only applies to the strings and floats. So in your case it has no
difference.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ