Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy | Date | Sun, 7 Jun 2020 13:03:45 +0000 |
| |
From: Herbert Xu > Sent: 05 June 2020 13:17 ... > Better yet use strscpy which will even return an error for you.
It really ought to return the buffer length on truncation. Then you can loop: while(...) buf += strxxxcpy(buf, src, buf_end - buf); and only check right at the end.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |