Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Prevent inadvertant cast-away-const

...

Code Block
bgColor#ccccff
size_t count_preceding_whitespace(const char *s) {
  const char *t = s;
  size_t length = strlen(s) + 1;

  while (isspace((const unsigned char)*t) && (t - s < length)) {
    ++t;
  }
  return t - s;
}

...