From a80cc44fb1160466f15a49a37d6a8333ceed5776 Mon Sep 17 00:00:00 2001 From: "Glenn K. Lockwood" Date: Mon, 23 Apr 2018 13:10:04 -0700 Subject: [PATCH] fixes #47 --- src/ior.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ior.c b/src/ior.c index 08b00d2..6aaf572 100755 --- a/src/ior.c +++ b/src/ior.c @@ -181,6 +181,7 @@ int main(int argc, char **argv) void init_IOR_Param_t(IOR_param_t * p) { const char *default_aiori = aiori_default (); + char *hdfs_user; assert (NULL != default_aiori); @@ -208,7 +209,10 @@ void init_IOR_Param_t(IOR_param_t * p) p->setAlignment = 1; p->lustre_start_ost = -1; - strncpy(p->hdfs_user, getenv("USER"), MAX_STR); + hdfs_user = getenv("USER"); + if (!hdfs_user) + hdfs_user = ""; + strncpy(p->hdfs_user, hdfs_user, MAX_STR); p->hdfs_name_node = "default"; p->hdfs_name_node_port = 0; /* ??? */ p->hdfs_fs = NULL;