[PATCH] strscpy() returns a negative value on failure unlike strlcpy().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--HPS
>From dbdd6c5833103880337e23d56d08f44741589a19 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@xxxxxxxxxxx>
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@xxxxxxxxxxx>
---
 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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux