From: Trent Piepho Date: Fri, 27 Apr 2007 15:31:27 +0000 (-0300) Subject: V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length X-Git-Tag: v2.6.22-rc1~1118^2~144 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982dd1bdaab39185ccd55cafd3c099b7fee5f2dd;p=linux-2.6 V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length Better to use sizeof() to get the size of the output buffer for the tuner name, instead of just hard coding 128. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 62de760c84..43084bfc0f 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c @@ -640,7 +640,8 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); - strncpy(fe->ops.tuner_ops.info.name, desc->name, 128); + strncpy(fe->ops.tuner_ops.info.name, desc->name, + sizeof(fe->ops.tuner_ops.info.name)); fe->ops.tuner_ops.info.frequency_min = desc->min; fe->ops.tuner_ops.info.frequency_min = desc->max;