mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
typo fixes
This commit is contained in:
parent
d17e8ac32f
commit
1b06e0be96
101 changed files with 160 additions and 160 deletions
|
@ -27,7 +27,7 @@ sprintf offers the ability to make a lot of failures since it does not know
|
|||
the size of the buffer it uses. Therefore usage of sprintf often
|
||||
results in possible entries for buffer overrun attacks. So please
|
||||
use this version only if you are sure the call is safe. sprintf
|
||||
allways terminstes the buffer it writes to.
|
||||
always terminstes the buffer it writes to.
|
||||
|
||||
snprintf knows the buffers size and will not write behind it. But you will
|
||||
have to use either a static buffer or allocate a dynamic buffer
|
||||
|
@ -48,7 +48,7 @@ spprintf is the dynamical version of snprintf. It allocates the buffer in size
|
|||
snprintf and offers possible memory leakes if you miss freeing the
|
||||
buffer allocated by the function. Therfore this function should be
|
||||
used where either no maximum is known or the maximum is much bigger
|
||||
than normal size required. spprintf allways terminates the buffer.
|
||||
than normal size required. spprintf always terminates the buffer.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -60,7 +60,7 @@ Example:
|
|||
sprintf(buffer, "test"); | snprintf(buffer, MAX, "test"); | spprintf(&buffer, MAX, "text");
|
||||
| | if (!buffer)
|
||||
| | return OUT_OF_MEMORY
|
||||
// sprintf allways terminates | // manual termination of | // spprintf allays terminates buffer
|
||||
// sprintf always terminates | // manual termination of | // spprintf allays terminates buffer
|
||||
// buffer | // buffer *IS* required |
|
||||
| buffer[MAX-1] = 0; |
|
||||
action_with_buffer(buffer); | action_with_buffer(buffer); | action_with_buffer(buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue