Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e73f9f68 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: dvb_vb2: use strlcpy instead of strncpy



Instead of using strncpy(), use strlcpy(), in order to
ensure that a \0 char will be added at the end of the
string.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent eb0f73ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)
	spin_lock_init(&ctx->slock);
	INIT_LIST_HEAD(&ctx->dvb_q);

	strncpy(ctx->name, name, DVB_VB2_NAME_MAX);
	strlcpy(ctx->name, name, DVB_VB2_NAME_MAX);
	ctx->nonblocking = nonblocking;
	ctx->state = DVB_VB2_STATE_INIT;