Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!mintaka!spdcc!ima!haddock!wildbill From: wildbill@haddock.ima.isc.com (Bill Torcaso) Newsgroups: comp.std.c Subject: Re: strncat is insufficient Message-ID: <17534@haddock.ima.isc.com> Date: 27 Aug 90 13:35:06 GMT References: <17418@haddock.ima.isc.com> <13598@smoke.BRL.MIL> <1990Aug23.132400.3654@zorch.SF-Bay.ORG> <587@array.UUCP> <620.26d6d0cd@iccgcc.decnet.ab.com> <1990Aug26.023859.12298@zoo.toronto.edu> Reply-To: wildbill@haddock.ima.isc.com (Bill Torcaso) Organization: Segue Software, Cambridge, MA 02138-5302 Lines: 6 I recall a kernel guru telling me (in the Unix system-III era, which is when the strn* functions appeared), that strncpy was used to copy a filename into a 14-character long entry in a directory. If the name was shorter, it got NUL-extended. Otherwise it filled the 14 chars and no space was 'wasted' on the NUL byte.