Content deleted Content added
→Character encodings: Clarifications. |
|||
Line 47:
Many attempts to make C string handling less error prone have been made. One strategy is to add safer functions such as <code>[[strdup]]</code> and <code>[[strlcpy]]</code>, whilst [[C standard library#Buffer overflow vulnerabilities | deprecating the use of unsafe functions]] such as <code>[[gets() | gets]]</code>. Another is to add an object-oriented wrapper around C strings so that only safe calls can be done. Neither has had a huge success as it is always possible and tempting to call the unsafe functions anyway.
Most modern libraries replace C strings with a structure containing a 32-bit or larger length value (far more than were ever considered for length-prefixed strings), and often add another pointer, a reference count, and even a NUL to speed up conversion back to a C string
==See also==
|