[dpdk-dev] [PATCH 21.08] power: refactor pstate sysfs handling
Burakov, Anatoly
anatoly.burakov at intel.com
Tue Apr 6 12:05:20 CEST 2021
On 02-Apr-21 6:46 PM, Stephen Hemminger wrote:
> On Thu, 1 Apr 2021 15:05:17 +0000
> Anatoly Burakov <anatoly.burakov at intel.com> wrote:
>
>> + /* fgets puts null terminator in, but do this just in case */
>> + buf[BUFSIZ - 1] = '\0';
>> +
>> + /* strip off any terminating newlines */
>> + if (strlen(buf))
>> + strtok(buf, "\n");
>
> Why not the simpler/shorter
> strchrnul(buf, '\n') = '\0';
>
How many more string functions are there that i don't know about :D
--
Thanks,
Anatoly
More information about the dev
mailing list