Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider v2.4 (sch jbop) (X_X)@==(Q_Q)@

...

isalnum()

isalpha()

isascii()

isblank()

iscntrl()

isdigit()

isgraph()

islower()

isprint()

ispunct()

isspace()

isupper()

isxdigit()

toascii()

toupper()

tolower()

...

Noncompliant Code Example

This non-compliant noncompliant code example may pass invalid values to the isspace() function.

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

  /* possibly *t < 0 */
  while (isspace(*t) && (t - s < length)) {
    ++t;
  }
  return t - s;
}

...

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

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

...

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

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

...