Re: [PATCH v3] x86/platform/uv: refactor deprecated strcpy and strncpy

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

 



On Wed, Sep 6, 2023 at 3:16 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> On 9/6/23 14:10, Ingo Molnar wrote:

>         strscpy(arg, val, strnchrnul(val, sizeof(arg)-1, '\n') - val + 1);

If you want to make it short and more readable, you can use

  strscpy(arg, val, sizeof(arg));
  strreplace(arg, '\n', '\0');

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux