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