rpi3-xenomai icon indicating copy to clipboard operation
rpi3-xenomai copied to clipboard

error "strncpy" when make tools

Open nghiank97 opened this issue 7 months ago • 1 comments

error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation] strncpy(ifr.ifr_name, txdev, IFNAMSIZ);

nghiank97 avatar Dec 19 '23 07:12 nghiank97

my solution is replace strncpy to snprintf. Ex :

  • strncpy (ifr.ifr_name, argv[1], IFNAMSIZ);
  • snprintf(ifr.ifr_name, IFNAMSIZ, "%s", argv[1]);

nghiank97 avatar Dec 19 '23 07:12 nghiank97