Browse Source

Copy also NUL Character when depth is set to zero

Corentin Salingue 8 years ago
parent
commit
398cefc1ae
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/common/utils.c

+ 1 - 1
src/common/utils.c

@@ -263,7 +263,7 @@ char *_starpu_mktemp_many(const char *directory, int depth, int flags, int *fd)
 		return NULL;
 	}
 
-	memcpy(path, directory, len);
+	memcpy(path, directory, len+1);
 	for (i = 0; i < depth; i++)
 	{
 		int r = starpu_lrand48();