]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length
authorTrent Piepho <xyzzy@speakeasy.org>
Fri, 27 Apr 2007 15:31:27 +0000 (12:31 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:44:00 +0000 (15:44 -0300)
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 <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/dvb-pll.c

index 62de760c844ff09683589a77389c879e24cc1ee6..43084bfc0f18b1e561963ada4b43f97319a906a0 100644 (file)
@@ -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;