lkml.org 
[lkml]   [2023]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/1] kasan: Replace strreplace() with strchrnul()
On Wed, Jun 28, 2023 at 05:39:26PM +0200, Alexander Potapenko wrote:
> On Wed, Jun 28, 2023 at 5:34 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:

...

> > /* Strip line number; without filename it's not very helpful. */
> > - strreplace(token, ':', '\0');
> > + p[strchrnul(token, ':') - token] = '\0';
>
> Why not just
> *(strchrnul(token, ':')) = '\0';
> ?

I don't like Pythonish style in the C. But if you insist, I can update it.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-06-29 11:23    [W:0.053 / U:2.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site