Use memcpy instead of strncpy in nscd/nscd.h to fix build problem with ToT GCC

* nscd/nscd.h (init_traced_file): Change strncpy to memcpy.
This commit is contained in:
Steve Ellcey 2017-12-12 13:47:32 -08:00
parent cc683f7ed4
commit eb4285768b
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2017-12-12 Steve Ellcey <sellcey@cavium.com>
* nscd/nscd.h (init_traced_file): Change strncpy to memcpy.
2017-12-12 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* libio/Makefile (tests): Add tst-bz22415.

View File

@ -108,7 +108,7 @@ init_traced_file(struct traced_file *file, const char *fname, int crinit)
size_t len = (size_t)(dname - fname);
if (len > sizeof (file->dname))
abort ();
strncpy (file->dname, file->fname, len);
memcpy (file->dname, file->fname, len);
file->dname[len] = '\0';
}
/* The basename is the name just after the last forward slash. */