Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: ENV30 compliance

...

Code Block
bgColor#FFcccc
char copy[16];
const char *temp = getenv("TEST_ENV");
if (temp != NULL) {
  strcpy(copy, temp);
}

...

Code Block
bgColor#ccccff
char *copy = NULL;
const char *temp = getenv("TEST_ENV");
if (temp != NULL) {
  copy = (char *)malloc(strlen(temp) + 1);
  if (copy != NULL) {
    strcpy(copy, temp);
  }
  else {
    /* handle error condition */
  }
}

...