LinuxTV Patchwork strscpy() returns a negative value on failure unlike strlcpy().

login
register
mail settings
Submitter Hans Petter Selasky
Date Jan. 25, 2019, 1:01 p.m.
Message ID <1973b9cd-9138-fc85-7aff-391cb0f42e71@selasky.org>
Download mbox | patch
Permalink /patch/54166/
State New
Headers show

Comments

Hans Petter Selasky - Jan. 25, 2019, 1:01 p.m.
--HPS

Patch

From dbdd6c5833103880337e23d56d08f44741589a19 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@selasky.org>
Date: Fri, 25 Jan 2019 13:59:01 +0100
Subject: [PATCH] strscpy() returns a negative value on failure unlike
 strlcpy().

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index c63746968fa3..5cf2d5d91999 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1354,7 +1354,7 @@  static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 	}
 
 	if (descr)
-		WARN_ON(strscpy(fmt->description, descr, sz) >= sz);
+		WARN_ON(strscpy(fmt->description, descr, sz) < 0);
 	fmt->flags = flags;
 }
 
-- 
2.20.1


Privacy Policy