[rtems-libbsd commit] nfsclient: Only parse for options when present.

Chris Johns chrisj at rtems.org
Fri Aug 12 06:10:22 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    c83cf5cba823ed06984c6e30f40eb6395c4ed970
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=c83cf5cba823ed06984c6e30f40eb6395c4ed970

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Aug 12 12:19:48 2016 +1000

nfsclient: Only parse for options when present.

---

 rtemsbsd/nfsclient/nfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/rtemsbsd/nfsclient/nfs.c b/rtemsbsd/nfsclient/nfs.c
index b68bab3..53b0ff1 100644
--- a/rtemsbsd/nfsclient/nfs.c
+++ b/rtemsbsd/nfsclient/nfs.c
@@ -1809,7 +1809,10 @@ RpcUdpServer		nfsServer = 0;
 int					e         = -1;
 char				*path     = mt_entry->dev;
 const char          *options = (const char*) data;
-bool                verbose = strstr(options, "-v") != NULL;
+bool                verbose = false;
+
+	if (options != NULL)
+		verbose = strstr(options, "-v") != NULL;
 
 	if (rpcUdpInit (verbose) < 0) {
 		fprintf (stderr, "error: initialising RPC\n");



More information about the vc mailing list