From b3e14c46ecb069b3076ca052e7180048dd863e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bonnard?= Date: Wed, 31 Jan 2018 13:48:55 +0100 Subject: Fix FTBFS with -Werror=format-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i2c.c fails to compile with gcc7 and -Werror=format-overflow used in Debian Unstable and Ubuntu 18.04 : i2c.c: In function ‘i2c_init’: i2c.c:211:15: error: ‘%s’ directive writing up to 255 bytes into a region of size 236 [-Werror=format-overflow=] dpath is supposed to store an entire path. Reported-by: Michel Normand Signed-off-by: Frédéric Bonnard Reviewed-by: Andrew Donnellan Signed-off-by: Stewart Smith --- external/opal-prd/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'external') diff --git a/external/opal-prd/i2c.c b/external/opal-prd/i2c.c index ba4b3c8..0c9947c 100644 --- a/external/opal-prd/i2c.c +++ b/external/opal-prd/i2c.c @@ -211,7 +211,7 @@ void i2c_init(void) #define SYSFS "/sys" /* XXX Find it ? */ DIR *devsdir; struct dirent *devent; - char dpath[NAME_MAX]; + char dpath[PATH_MAX]; char busname[256]; char *s; FILE *f; -- cgit v1.1