This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] Fix gdb.gdbtk/simple.c strncpy args
- From: Fred Fish <fnf at intrinsity dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: fnf at intrinsity dot com
- Date: Sat, 7 Sep 2002 20:56:04 -0500 (CDT)
- Subject: [RFA] Fix gdb.gdbtk/simple.c strncpy args
- Reply-to: fnf at intrinsity dot com
Strncpy is supposed to take pointers...
simple.c: In function `main':
simple.c:15: warning: passing arg 1 of `strncpy' makes pointer from integer without a cast
simple.c:15: warning: passing arg 2 of `strncpy' makes pointer from integer without a cast
WARNING: Testcase compile failed, so some tests in this file will automatically fail.
2002-09-07 Fred Fish <fnf@intrinsity.com>
* simple.c: Pass addresses to strncpy, not chars.
Index: simple.c
===================================================================
RCS file: /mips/newtools/fsf/gdb/gdb/testsuite/gdb.gdbtk/simple.c,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 simple.c
*** simple.c 2002/07/04 20:33:37 1.1.1.1
--- simple.c 2002/09/08 01:23:50
*************** main(int argc, char * argv[])
*** 12,18 ****
{
int j = i % 3;
int k = 3 - j;
! strncpy (a[i], b[k], j);
foo = (long) j * k / i + 2 * k * k * k;
}
return 0;
--- 12,18 ----
{
int j = i % 3;
int k = 3 - j;
! strncpy (&a[i], &b[k], j);
foo = (long) j * k / i + 2 * k * k * k;
}
return 0;