From b88691c30f077c08da83d925a8070b489c1bd2f0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 16 Nov 1999 15:26:29 +0000 Subject: Source and destination arguments to strncpy were swapped. This mistake was made in the conversion of bcopy() to strncpy(). --- c/src/exec/libcsupport/src/scandir.c | 2 +- c/src/lib/libc/scandir.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/src/exec/libcsupport/src/scandir.c b/c/src/exec/libcsupport/src/scandir.c index 25f3263187..43c7c51747 100644 --- a/c/src/exec/libcsupport/src/scandir.c +++ b/c/src/exec/libcsupport/src/scandir.c @@ -112,7 +112,7 @@ scandir(dirname, namelist, select, dcomp) p->d_ino = d->d_ino; p->d_reclen = d->d_reclen; p->d_namlen = d->d_namlen; - strncpy(d->d_name, p->d_name, p->d_namlen + 1); + strncpy(p->d_name, d->d_name, p->d_namlen + 1); /* * Check to make sure the array has space left and * realloc the maximum size. diff --git a/c/src/lib/libc/scandir.c b/c/src/lib/libc/scandir.c index 25f3263187..43c7c51747 100644 --- a/c/src/lib/libc/scandir.c +++ b/c/src/lib/libc/scandir.c @@ -112,7 +112,7 @@ scandir(dirname, namelist, select, dcomp) p->d_ino = d->d_ino; p->d_reclen = d->d_reclen; p->d_namlen = d->d_namlen; - strncpy(d->d_name, p->d_name, p->d_namlen + 1); + strncpy(p->d_name, d->d_name, p->d_namlen + 1); /* * Check to make sure the array has space left and * realloc the maximum size. -- cgit v1.2.3