From: Edward Ocampo-Gooding Date: 2013-10-18T12:03:47-04:00 Subject: [ruby-core:57932] strlen and strnlen in Ruby --Apple-Mail=_269DFD50-A179-420A-88D0-D2455A09911C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi there, Is there a reason why strcpy is used in some places but strncpy in = others? (I=92ve been dogmatically following the advice of my elders to favour = strncpy whenever possible since it=92s easy to run into security issues = or accidentally feeding a non-null-byte-terminated string in and having = the program crash or worse yet, use the result without checking.) Edward --Apple-Mail=_269DFD50-A179-420A-88D0-D2455A09911C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi = there,

Is there a reason why strcpy is used in some = places but strncpy in others?

(I=92ve been = dogmatically following the advice of my elders to favour strncpy = whenever possible since it=92s easy to run into security issues or = accidentally feeding a non-null-byte-terminated string in and having the = program crash or worse yet, use the result without checking.)

Edward

= --Apple-Mail=_269DFD50-A179-420A-88D0-D2455A09911C--