Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!udel!wuarchive!wugate!uunet!mcsun!hp4nl!tnosoes!tom From: tom@tnosoes.UUCP (Tom Vijlbrief) Newsgroups: gnu.g++.bug Subject: Re: memcpy(), memcmp() in cplus-dem.c Message-ID: <500@tnosoes.UUCP> Date: 14 Nov 89 07:46:36 GMT References: <8911131003.AA01009@comp.vuw.ac.nz> Distribution: gnu Organization: TNO Institute for Perception, Soesterberg, The Netherlands Lines: 23 jonathan@comp.vuw.ac.nz writes: >ld++ will not build on some 4.2-based Unix systems, because >cplus-dem.c assumes it is either running on a sequent, or a System V >machine (which, these days, includes Suns) that has memcpy() and >/usr/include/memory.h. The following change seems more portable, and >more in the spirit of other GNU code: > #define memcpy(s1, s2, n) strncpy(s1, s2, n) According to the manual page on my Sun strncpy will "null-pad" s2 when it finds a zero byte before the n bytes are copied. So memcpy and strncpy will often be not compatible. Tom =============================================================================== Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 562 11 3769 ZG Soesterberg E-mail: tnosoes!tom@mcvax.cwi.nl The Netherlands or: uunet!mcvax!tnosoes!tom ===============================================================================