Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Compliant Code Example (TR24731-1)

Code Block
bgColor#CCCCFF
constraint/* 
 * The abort_handler_t handle_errorss() {
function writes /* define what to do whena message on the 
 * standard error occurs */
 stream then calls the abort();
}

/*... function.
 */

set_constraint_handler(handleabort_handler_errorss);

/*...*/

/* Returns zero on success */
errno_t function(char* dst1){
  char src1[100] = "hello";

  strcpy_s(dst1, sizeof(dst1), src1);
  /* sinceBecause handle_errors() never returns,
     we only get here if strcpy_s() succeeds. */

  /* ... */
  return 0;
}

...