Browse Source

[media] em28xx: pass correct buffer size to snprintf

snprintf()'s size parameter includes space for the terminating '\0' character.

Signed-off-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Chris Rankin 14 years ago
parent
commit
f38f333952
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/media/video/em28xx/em28xx-cards.c

+ 1 - 1
drivers/media/video/em28xx/em28xx-cards.c

@@ -3154,7 +3154,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
 		goto err;
 	}
 
-	snprintf(dev->name, 29, "em28xx #%d", nr);
+	snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr);
 	dev->devno = nr;
 	dev->model = id->driver_info;
 	dev->alt   = -1;