
15 Jul
2011
15 Jul
'11
11:21 a.m.
On Thu, Jul 14, 2011 at 02:02:42PM -0400, Mike Frysinger wrote:
On Thursday, July 14, 2011 09:49:23 Albert ARIBAUD wrote:
Please use strncpy() which will also guard against overflows.
or BUG_ON(strlen(name) >= MDIO_NAME_LEN) -mike
Patch v3 has both. The original code did have a check for the name overflowing but BUG_ON() is IMO clearer so I switched to using it instead. I kept strncpy() in v3, rather than just strcpy(), because it makes the code robust against future edits. Thanks for the feedback.
Bye for now,
--
Laurence Withers, lwithers@guralp.com http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643 Software Engineer
General support queries: support@guralp.com CMG-DCM CMG-EAM CMG-NAM