>> strncpy() won't put a terminating zero on there, is everything >> that uses the resulting string okay with that? Also, if the >> name gets cut short, it might match some _other_ expected name. > > On Wed, 1 Aug 2007, Scott Wood wrote: > >> You could use strlcpy() instead, which always leaves a zero >> terminator. > > The patch below does exactly this - uses strlcpy() to guarantee > strings in > i2c device type and driver_name fields are 0-terminated.
You're not checking the return values of these calls. This would be a good function to put attribute warn_unused_result on :-) Segher _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev