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 <stdio.h> ? #include <string.h> ? ? 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:[EMAIL PROTECTED] 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/