Linux-NFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH] nfs-utils: Removed new error=format-overflow=2 errors
@ 2019-01-29 20:34 Steve Dickson
  2019-01-30 19:05 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2019-01-29 20:34 UTC (permalink / raw)
  To: Linux NFS Mailing list

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

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/blkmapd/device-discovery.c | 2 +-
 utils/mount/error.c              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
index 3a202e0..2ce60f8 100644
--- a/utils/blkmapd/device-discovery.c
+++ b/utils/blkmapd/device-discovery.c
@@ -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();
diff --git a/utils/mount/error.c b/utils/mount/error.c
index dfe5c7d..562f312 100644
--- a/utils/mount/error.c
+++ b/utils/mount/error.c
@@ -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)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfs-utils: Removed new error=format-overflow=2 errors
  2019-01-29 20:34 [PATCH] nfs-utils: Removed new error=format-overflow=2 errors Steve Dickson
@ 2019-01-30 19:05 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2019-01-30 19:05 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 1/29/19 3:34 PM, Steve Dickson wrote:
> 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
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed.... 

steved.

> ---
>  utils/blkmapd/device-discovery.c | 2 +-
>  utils/mount/error.c              | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
> index 3a202e0..2ce60f8 100644
> --- a/utils/blkmapd/device-discovery.c
> +++ b/utils/blkmapd/device-discovery.c
> @@ -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();
> diff --git a/utils/mount/error.c b/utils/mount/error.c
> index dfe5c7d..562f312 100644
> --- a/utils/mount/error.c
> +++ b/utils/mount/error.c
> @@ -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)
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 20:34 [PATCH] nfs-utils: Removed new error=format-overflow=2 errors Steve Dickson
2019-01-30 19:05 ` Steve Dickson

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox