Skip to content

Commit 4ec6dc9

Browse files
TylerMSFTTylerMSFT
authored andcommitted
fix github #4510
1 parent 52803ee commit 4ec6dc9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/c-runtime-library/reference/setlocale-wsetlocale.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "setlocale, _wsetlocale"
33
description: "Describes the Microsoft C runtime (CRT) library functions setlocale and _wsetlocale."
4-
ms.date: 05/05/2022
4+
ms.date: 4/20/2023
55
api_name: ["_wsetlocale", "setlocale", "_o__wsetlocale", "_o_setlocale"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-locale-l1-1-0.dll"]
77
api_type: ["DLLExport"]
@@ -21,6 +21,7 @@ char *setlocale(
2121
int category,
2222
const char *locale
2323
);
24+
2425
wchar_t *_wsetlocale(
2526
int category,
2627
const wchar_t *locale
@@ -40,9 +41,17 @@ Locale specifier.
4041
If a valid *`locale`* and *`category`* are given, the functions return a pointer to the string associated with the specified *`locale`* and *`category`*.
4142
If the *`locale`* argument is `NULL`, the functions return the current locale.
4243

43-
If the *`locale`* or *`category`* isn't valid, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, each function sets `errno` to `EINVAL`, and returns `NULL`.
44+
If an invalid argument is passed to either function, the return value is `NULL`.
45+
The behavior for invalid arguments is as follows:
46+
47+
|Function | Invalid parameter | Invalid handler invoked as described in [Parameter validation](../parameter-validation.md)| Sets `errno` |
48+
|---------|---------|---------|
49+
| `setlocale` | *`category`* | yes | yes |
50+
| `setlocale` | *`locale`* | no | no |
51+
| `_wsetlocale` | *`category`* | yes | yes |
52+
| `_wsetlocale` | *`locale`* | no | no |
4453

45-
The call
54+
The call:
4655

4756
```C
4857
setlocale( LC_ALL, "en-US" );

0 commit comments

Comments
 (0)