« Previous | Next » 

Revision 1ab516ed

ID1ab516ed9b6ba00bafc5ca37604f8af4680323ca

Added by Jim Meyering over 11 years ago

qemu-ga: prefer pstrcpy: consistently NUL-terminate ifreq.ifr_name

NUL-termination of the .ifr_name field is not required, but is fine
(and preferable to using strncpy and leaving the reader to wonder),
since the first thing the linux kernel does is to clear the last byte.
Besides, using pstrcpy here makes this setting of ifr_name consistent
with the other code (e.g., net/tap-linux.c) that does the same thing.

Reviewed-by: Luiz Capitulino <>
Signed-off-by: Jim Meyering <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences