Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
FILE* f;
const char *editor;
char *file_name;

/* initialize file_name */

f = fopen(file_name, "r");
if (f == NULL) {
  /* Handle fopen() error */
}
/* ... */
editor = getenv("EDITOR");
if (editor == NULL) {
  /* Handle getenv() error */
}
if (system(editor) == -1) {
  /* Handle Error */
}

...

Code Block
bgColor#ccccff
FILE* f;
const char *editor;
char *file_name;

/* initialize file_name */

f = fopen(file_name, "r");
if (f == NULL) {
  /* Handle fopen() error */
}
/* ... */
fclose(f);
f = NULL;
editor = getenv("EDITOR");
if (editor == NULL) {
  /* Handle getenv() error */
}
/* Sanitize environment before calling system()! */
if (system(editor) == -1) {
  /* Handle Error */
}

...