Re: [PATCH 1/2] libblkid: add interface for FSSIZE field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 21, 2022 at 03:09:45PM +0200, Andrey Albershteyn wrote:
> +int blkid_probe_set_fssize(blkid_probe pr, unsigned long long size)

I'd prefer uint64_t  rather than unsigned long long


> +{
> +	struct blkid_chain *chn = blkid_probe_get_chain(pr);
> +	char u[20];
> +
> +	if (!(chn->flags & BLKID_SUBLKS_FSSIZE))
> +		return 0;
> +
> +	snprintf(u, sizeof(u), "%llu", size);
> +
> +	return blkid_probe_set_value(pr, "FSSIZE", (unsigned char *) u, strlen(u) + 1);
> +}

  return blkid_probe_sprintf_value(pr, "FSSIZE", "%" PRIu64, size);

and you not need snprintf(), etc.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux