Skip to content

Commit

Permalink
V4L/DVB (5360): Dvb-pll: Use sizeof() to get name length
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Apr 27, 2007
1 parent 51dec1f commit 982dd1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/dvb/frontends/dvb-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 982dd1b

Please sign in to comment.