From: Paul Clarke
> Sent: 14 June 2018 14:18
...
> > + /* Remove trailing newline from sysfs file */
> > + cp = strrchr(buf, '\n');
> > + if (cp)
> > + *cp = '\0';
>
> A nit, perhaps, but this will search backwards through the entire string if a
> newline is not found,
> which is
Em Thu, Jun 14, 2018 at 01:48:43PM +0200, Thomas Richter escreveu:
> Remove a trailing newline when reading sysfs file contents
> + /* Remove trailing newline from sysfs file */
> + cp = strrchr(buf, '\n');
> + if (cp)
> + *cp = '\0';
> +
We have rtrim()
- Arnaldo
On 06/14/2018 03:17 PM, Paul Clarke wrote:
> On 06/14/2018 06:48 AM, Thomas Richter wrote:
>> Remove a trailing newline when reading sysfs file contents
>> such as /sys/devices/cpum_cf/events/TX_NC_TEND.
>> This show when verbose option -v is used.
>>
>> Output before:
>> tx_nc_tend -> 'cpum_cf'/'e
On 06/14/2018 06:48 AM, Thomas Richter wrote:
> Remove a trailing newline when reading sysfs file contents
> such as /sys/devices/cpum_cf/events/TX_NC_TEND.
> This show when verbose option -v is used.
>
> Output before:
> tx_nc_tend -> 'cpum_cf'/'event=0x008d
> '/
>
> Output after:
> tx_nc_tend -
Remove a trailing newline when reading sysfs file contents
such as /sys/devices/cpum_cf/events/TX_NC_TEND.
This show when verbose option -v is used.
Output before:
tx_nc_tend -> 'cpum_cf'/'event=0x008d
'/
Output after:
tx_nc_tend -> 'cpum_cf'/'event=0x8d'/
Signed-off-by: Thomas Richter
---
too
5 matches
Mail list logo