Skip to content

Commit 434ebe3

Browse files
Merge pull request #5216 from TylerMSFT/github
Fixes #3706
2 parents 90bdf09 + 0a4d7df commit 434ebe3

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

docs/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ int _fstat(
2222
);
2323
int _fstat32(
2424
int fd,
25-
struct __stat32 *buffer
25+
struct _stat32 *buffer
2626
);
2727
int _fstat64(
2828
int fd,
29-
struct __stat64 *buffer
29+
struct _stat64 *buffer
3030
);
3131
int _fstati64(
3232
int fd,
@@ -73,7 +73,7 @@ If *`fd`* refers to a device, the **`st_atime`**, **`st_ctime`**, **`st_mtime`**
7373

7474
Because `Stat.h` uses the [`_dev_t`](../standard-types.md) type, which is defined in `Types.h`, you must include `Types.h` before `Stat.h` in your code.
7575

76-
**`_fstat64`**, which uses the `__stat64` structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. The lower bound of the date range for all these functions is Midnight, January 1, 1970.
76+
**`_fstat64`**, which uses the `_stat64` structure, allows file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC; whereas the other functions only represent dates through 23:59:59 January 18, 2038, UTC. The lower bound of the date range for all these functions is Midnight, January 1, 1970.
7777

7878
Variations of these functions support 32-bit or 64-bit time types and 32-bit or 64-bit file lengths. The first numerical suffix (**`32`** or **`64`**) indicates the size of the time type used; the second suffix is either **`i32`** or **`i64`**, indicating whether the file size is represented as a 32-bit or 64-bit integer.
7979

docs/c-runtime-library/reference/memcpy-wmemcpy.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["wmemcpy", "memcpy"]
1010
helpviewer_keywords: ["wmemcpy function", "memcpy function"]
11-
ms.assetid: 34abb90b-bffb-46dc-a2f3-a5e9940839d6
1211
---
1312
# `memcpy`, `wmemcpy`
1413

@@ -49,14 +48,14 @@ The value of *`dest`*.
4948
**`memcpy`** copies *`count`* bytes from *`src`* to *`dest`*; **`wmemcpy`** copies *`count`* wide characters. If the source and destination regions overlap, the behavior of **`memcpy`** is undefined. Use **`memmove`** to handle overlapping regions.
5049

5150
> [!IMPORTANT]
52-
> Make sure that the destination buffer is the same size or larger than the source buffer. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
51+
> Make sure that the destination buffer is large enough to accommodate the number of copied characters. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
5352
5453
> [!IMPORTANT]
5554
> Because so many buffer overruns, and thus potential security exploits, have been traced to improper usage of **`memcpy`**, this function is listed among the "banned" functions by the Security Development Lifecycle (SDL). You may observe that some VC++ library classes continue to use **`memcpy`**. Furthermore, you may observe that the VC++ compiler optimizer sometimes emits calls to **`memcpy`**. The Visual C++ product is developed in accordance with the SDL process, and thus usage of this banned function has been closely evaluated. In the case of library use of it, the calls have been carefully scrutinized to ensure that buffer overruns will not be allowed through these calls. In the case of the compiler, sometimes certain code patterns are recognized as identical to the pattern of **`memcpy`**, and are thus replaced with a call to the function. In such cases, the use of **`memcpy`** is no more unsafe than the original instructions would have been; they have simply been optimized to a call to the performance-tuned **`memcpy`** function. Just as the use of "safe" CRT functions doesn't guarantee safety (they just make it harder to be unsafe), the use of "banned" functions doesn't guarantee danger (they just require greater scrutiny to ensure safety).
5655
>
5756
> Because **`memcpy`** usage by the VC++ compiler and libraries has been so carefully scrutinized, these calls are permitted within code that otherwise conforms with the SDL. **`memcpy`** calls introduced in application source code only conform with the SDL when that use has been reviewed by security experts.
5857
59-
The **`memcpy`** and **`wmemcpy`** functions are only deprecated if the constant `_CRT_SECURE_DEPRECATE_MEMORY` is defined before the include statement, as in the example below:
58+
The **`memcpy`** and **`wmemcpy`** functions are only deprecated if the constant `_CRT_SECURE_DEPRECATE_MEMORY` is defined before the `#include` statement, as in the following examples:
6059

6160
```C
6261
#define _CRT_SECURE_DEPRECATE_MEMORY

docs/c-runtime-library/reference/memmove-wmemmove.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ The value of *`dest`*.
4747

4848
Copies *`count`* bytes (**`memmove`**) or characters (**`wmemmove`**) from *`src`* to *`dest`*. If some portions of the source and the destination regions overlap, both functions ensure that the original source bytes in the overlapping region are copied before being overwritten.
4949

50-
**Security Note** Make sure that the destination buffer is the same size or larger than the source buffer. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
50+
**Security Note** Make sure that the destination buffer is large enough to accommodate the number of moved characters. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
5151

52-
The **`memmove`** and **`wmemmove`** functions will only be deprecated if the constant `_CRT_SECURE_DEPRECATE_MEMORY` is defined before the inclusion statement in order for the functions to be deprecated, such as in the example below:
52+
The **`memmove`** and **`wmemmove`** functions are only deprecated if the constant `_CRT_SECURE_DEPRECATE_MEMORY` is defined before the `#include` statement, as shown in the following example:
5353

5454
```C
5555
#define _CRT_SECURE_DEPRECATE_MEMORY

docs/c-runtime-library/reference/toupper-toupper-towupper-toupper-l-towupper-l.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["CTYPE/toupper", "CTYPE/_toupper", "CTYPE/_toupper_l", "CORECRT_WCTYPE/towupper", "CORECRT_WCTYPE/_towupper_l", "TCHAR/_totupper", "TCHAR/_totupper_l", "toupper", "_toupper", "_toupper_l", "towupper", "_towupper_l", "_totupper", "_totupper_l"]
1010
helpviewer_keywords: ["_toupper function", "towupper function", "uppercase, converting strings to", "totupper function", "string conversion, to different characters", "towupper_l function", "toupper_l function", "string conversion, case", "_toupper_l function", "_towupper_l function", "_totupper function", "case, converting", "characters, converting", "toupper function"]
11-
ms.assetid: cdef1b0f-b19c-4d11-b7d2-cf6334c9b6cc
1211
---
1312
# `toupper`, `_toupper`, `towupper`, `_toupper_l`, `_towupper_l`
1413

@@ -52,19 +51,17 @@ If *`c`* is a wide character for which `iswlower` is nonzero and there's a corre
5251

5352
There's no return value reserved to indicate an error.
5453

55-
In order for **`toupper`** to give the expected results, [`__isascii`](isascii-isascii-iswascii.md) and [`islower`](islower-iswlower-islower-l-iswlower-l.md) must both return nonzero.
56-
5754
## Remarks
5855

5956
Each of these routines converts a given lowercase letter to an uppercase letter if possible and appropriate. The case conversion of **`towupper`** is locale-specific. Only the characters relevant to the current locale are changed in case. The functions without the `_l` suffix use the currently set locale. The versions of these functions with the `_l` suffix take the locale as a parameter and use that instead of the currently set locale. For more information, see [Locale](../locale.md).
6057

61-
In order for **`toupper`** to give the expected results, [`__isascii`](isascii-isascii-iswascii.md) and [`isupper`](isupper-isupper-l-iswupper-iswupper-l.md) must both return nonzero.
58+
For **`toupper`** to give the expected results, [`__isascii`](isascii-isascii-iswascii.md) must return nonzero.
6259

6360
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
6461

6562
### Generic-text routine mappings
6663

67-
| TCHAR.H routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
64+
| `TCHAR.H` routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
6865
|---|---|---|---|
6966
| `_totupper` | **`toupper`** | **`_mbctoupper`** | **`towupper`** |
7067
| `_totupper_l` | **`_toupper_l`** | **`_mbctoupper_l`** | **`_towupper_l`** |

0 commit comments

Comments
 (0)