Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Never use strncpy! Date: Thu, 22 Sep 2022 22:49:50 -0700 Organization: None to speak of Lines: 14 Message-ID: <87bkr6ej29.fsf@nosuchdomain.example.com> References: <87o7v8zc4x.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="6f3ec2dac4dea20474d57d340bf017a4"; logging-data="2600673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7ghdecbcPB/6vWcXfL/39" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:qGQA54cmgxPvJS8M6lisocXjWxM= sha1:6fvtz766JuoID7yE1CEj7tA1Tlg= Xref: csiph.com comp.lang.c++:86516 Andrey Tarasevich writes: [...] > ... and yes, Keith Thompson makes a good point that the source does > not have to be a zero-terminated string. I.e. it can also be used for > fixed-width string copying. To be fair, it was Ben Bacarisse who pointed this out -- *after* I had incorrectly stated (based on faulty man page) that the source has to be a pointer to a null-terminated string. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */