diff options
author | Frédéric Bonnard <frediz@linux.vnet.ibm.com> | 2018-01-31 13:48:55 +0100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-02-08 18:21:43 -0600 |
commit | b3e14c46ecb069b3076ca052e7180048dd863e5c (patch) | |
tree | 838376987c36861cf78f1c0fbaa0e52626771866 | |
parent | 729520fd9aa982a21863c3ee0529f8a74e096a4d (diff) | |
download | skiboot-b3e14c46ecb069b3076ca052e7180048dd863e5c.zip skiboot-b3e14c46ecb069b3076ca052e7180048dd863e5c.tar.gz skiboot-b3e14c46ecb069b3076ca052e7180048dd863e5c.tar.bz2 |
Fix FTBFS with -Werror=format-overflow
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 <michel.mno@free.fr>
Signed-off-by: Frédéric Bonnard <frediz@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | external/opal-prd/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |