delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/03/09:35:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 3 Mar 2005 09:34:14 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Derosa, Anthony CIV NAVAIR 2035, 2, 205/214" <Anthony DOT Derosa1 AT navy DOT mil>
cc: cygwin AT cygwin DOT com
Subject: RE: cygstart patch
In-Reply-To: <49D88D820A7BC0479A7B0932D4219EFE1DD0EE@NAEAPAXREX04VA.nadsusea.nads.navy.mil>
Message-ID: <Pine.GSO.4.61.0503030929000.11697@slinky.cs.nyu.edu>
References: <49D88D820A7BC0479A7B0932D4219EFE1DD0EE AT NAEAPAXREX04VA DOT nadsusea DOT nads DOT navy DOT mil>
MIME-Version: 1.0

On Thu, 3 Mar 2005, Derosa, Anthony  CIV NAVAIR 2035, 2, 205/214 wrote:

> What do you think about Chuck's concerns regarding strcat()
> vs. strncat()?

I'm no expert either, but usually the purpose of strncat() is to avoid a
buffer overrun when copying an arbitrary-sized string into a
statically-sized buffer (as the string may be longer than the buffer).
Since you're sizing the buffer dynamically to the exact string size, I
don't think there's anything wrong with using strcpy/strcat here (as long
as you check that the buffer is not NULL -- and you do).

> (I *didn't* regenerate this with diff, is that OK?
> I just changed the "1" to "2" and removed some whitespace.):

Mind the spaces/tabs in the *original* code.  As long as what you edited
is in your newly-added (or replacement) code, it should still apply.
HTH,
	Igor

> > From: cygwin-owner AT XXXXXX DOT XXX [mailto:cygwin-owner AT XXXXXX DOT XXX]On Behalf Of Dave Korn
> > To: cygwin AT XXXXXX DOT XXX

Oh, and <http://cygwin.com/acronyms/#PCYMTNQREAIYR>.  Thanks.
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019