Skip to contentSkip to conversation

nfs-utils: Removed new error=format-overflow=2 errors

PATCH In review Steve Dickson 1 participant 2 messages Jan 29, 2019 – Jan 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils: Removed new error=format-overflow=2 errors

With the latest C99-compliant gcc printf, sprintf, etc now only support up to 4k in buffer sizes. There were only a couple places that had to change to not violated this new restriction

---
 utils/blkmapd/device-discovery.c | 2 +-
 utils/mount/error.c              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
utils/blkmapd/device-discovery.c +1 -1
index 3a202e0..2ce60f8 100644
@@ -239,7 +239,7 @@ int bl_discover_devices(void)
 {
 	FILE *f;
 	int n;
-	char buf[PATH_MAX], devname[PATH_MAX], fulldevname[PATH_MAX+NAME_MAX];
+	char buf[PATH_MAX], devname[NAME_MAX], fulldevname[PATH_MAX];
 
 	/* release previous list */
 	bl_release_disk();
utils/mount/error.c +2 -2
index dfe5c7d..562f312 100644
@@ -50,8 +50,8 @@
 
 extern char *progname;
 
-static char errbuf[BUFSIZ];
-static char *erreob = &errbuf[BUFSIZ];
+static char errbuf[PATH_MAX];
+static char *erreob = &errbuf[PATH_MAX];
 
 /* Convert RPC errors into strings */
 static int rpc_strerror(int spos)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 6 lines · Steve Dickson

With the latest C99-compliant gcc printf, sprintf, etc now only support up to 4k in buffer sizes. There were only a couple places that had to change to not violated this new restriction

Committed....

steved.

Quoted 34 lines
---
 utils/blkmapd/device-discovery.c | 2 +-
 utils/mount/error.c              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
utils/blkmapd/device-discovery.c +1 -1
index 3a202e0..2ce60f8 100644
@@ -239,7 +239,7 @@ int bl_discover_devices(void)
 {
 	FILE *f;
 	int n;
-	char buf[PATH_MAX], devname[PATH_MAX], fulldevname[PATH_MAX+NAME_MAX];
+	char buf[PATH_MAX], devname[NAME_MAX], fulldevname[PATH_MAX];
 
 	/* release previous list */
 	bl_release_disk();
utils/mount/error.c +2 -2
index dfe5c7d..562f312 100644
@@ -50,8 +50,8 @@
 
 extern char *progname;
 
-static char errbuf[BUFSIZ];
-static char *erreob = &errbuf[BUFSIZ];
+static char errbuf[PATH_MAX];
+static char *erreob = &errbuf[PATH_MAX];
 
 /* Convert RPC errors into strings */
 static int rpc_strerror(int spos)