Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: Tue, 20 Apr 2004 10:24:23 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cygwin (december 2003 version) and strcat Message-ID: <20040420082423.GA26840@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i On Apr 19 23:49, Martin Johansen wrote: > Hi. > > I am experiencing problems using strcat and strncat. > > For some reason, these functions do not appent a zero. $ cat > str.c << EOF ? #include ? #include ? ? int ? main () ? { ? char c1[100], c2[100]; ? ? memset (c1, 0xff, 100); ? memset (c2, 0x77, 100); ? ? c1[0] = '\0'; ? c2[0] = '\0'; ? ? strcat (c1, "1234567890"); ? strncat (c2, "1234567890", 5); ? ? printf ("c1: <%s>\n", c1); ? printf ("c2: <%s>\n", c2); ? ? return 0; ? } ? EOF $ make str gcc str.c -o str $ ./str c1: <1234567890> c2: <12345> Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Co-Project Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- 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/