From a834f8aaf20c6c7041f125fe371d83634530912c Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 29 Sep 2008 15:29:39 -0400 Subject: Another try at fixing up reading errors from mount. --- isys/imount.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'isys') diff --git a/isys/imount.c b/isys/imount.c index 8ba1e668d..7655dc9b6 100644 --- a/isys/imount.c +++ b/isys/imount.c @@ -117,6 +117,8 @@ int doPwMount(char *dev, char *where, char *fs, char *options, char **err) { *err = NULL; } + memset(buf, '\0', 4096); + while ((rc = read(pipefd[0], &buf, 4096)) > 1) { i += rc + 1; @@ -124,7 +126,8 @@ int doPwMount(char *dev, char *where, char *fs, char *options, char **err) { abort(); } - *err = strncpy(*err, buf, rc); + *err = strncat(*err, buf, rc); + memset(buf, '\0', 4096); } } -- cgit