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)@

...

Do not attempt to modify a string literal. Use a named array of characters to obtain a modifiable string.

...

Noncompliant Code Example

In this non-compliant noncompliant code example, the char pointer p is initialized to the address of a string literal. Attempting to modify the string literal results in undefined behavior.

...

Code Block
bgColor#ccccff
char a[] = "string literal";
a[0] = 'S';

...

Noncompliant Code Example

In this non-compliant noncompliant example, the mktemp() function modifies its string argument.

...