Article ID: 115086
Article Last Modified on 11/21/2006
char *buf;
ASSERT(buf = (char *) calloc( 20, sizeof(char) ));
strcpy( buf, "Hello, World" );
free( buf );
This code runs perfectly in a debug version of an MFC application. If the
call to calloc() fails, a diagnostic message is displayed, which includes
the file and line number. However, in a retail build of an MFC application:
char *buf;
buf = (char *) calloc( 20, sizeof(char) );
ASSERT( buf != NULL );
strcpy( buf, "Hello, World" );
free( buf );
Or, you can use VERIFY instead:
char *buf;
VERIFY(buf = (char *) calloc(20, sizeof(char) ));
strcpy( buf, "Hello, World" );
free( buf );
Additional query words: 7.00 1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 hang gpf gp-fault 4.00
Keywords: kbprb KB115086