This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
strncat bug example
- To: gnu-win32 at cygnus dot com (GNU-Win32)
- Subject: strncat bug example
- From: "Axel Riese" <Axel dot Riese at risc dot uni-linz dot ac dot at>
- Date: Fri, 14 Nov 1997 09:27:53 +0100 (MET)
Hi all !
I was asked to give a code example where the COOLVIEW strncat function fails.
Consider the following (which is nonsense, but shows what's going on):
...
int main()
{
char string[10];
...
strcpy(string, "test");
...
/* make string empty and check */
string[0] = '\0';
printf(string);
/* append a character and check */
strncat(string, "x", 1);
printf(string);
return 0;
}
This example should print
->
-> x
(without arrows...), but it actually gives
->
-> testx
BTW, after replacing the cygwin.dll from COOLVIEW by its original b18 version,
the result is correct.
Hope this helps,
Axel
===============================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz
A-4040 Linz e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria URL: http://www.risc.uni-linz.ac.at/research/combinat/risc/
===============================================================================
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".