Skip to content

Commit

Permalink
[media] em28xx: pass correct buffer size to snprintf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Rankin authored and Mauro Carvalho Chehab committed Sep 3, 2011
1 parent c0f856d commit f38f333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f38f333

Please sign in to comment.