From 8f30b68871bde8687c7fcff8bac66e2b5765129e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 16 Sep 2009 17:07:01 +0000 Subject: - Add xcalloc() and call it - Fix memory errors found by valgrind - Remove multi_glob() and empower parse_file_seq() to do its job: the goal here is to remove the confusing reverse/re-reverse we do on the file lists: needed for future fixes. - Add a prefix arg to parse_file_seq() - Make concat() variadic so it can take arbitrary #'s of strings --- vmsfunctions.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'vmsfunctions.c') diff --git a/vmsfunctions.c b/vmsfunctions.c index 51a270e..2c87cb7 100644 --- a/vmsfunctions.c +++ b/vmsfunctions.c @@ -34,13 +34,11 @@ this program. If not, see . */ DIR * opendir (char *dspec) { - struct DIR *dir = (struct DIR *)xmalloc (sizeof (struct DIR)); - struct NAM *dnam = (struct NAM *)xmalloc (sizeof (struct NAM)); + struct DIR *dir = xcalloc (sizeof (struct DIR)); + struct NAM *dnam = xmalloc (sizeof (struct NAM)); struct FAB *dfab = &dir->fab; char *searchspec = xmalloc (MAXNAMLEN + 1); - memset (dir, 0, sizeof *dir); - *dfab = cc$rms_fab; *dnam = cc$rms_nam; sprintf (searchspec, "%s*.*;", dspec); -- cgit v1.2.3