You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Appends characters of a string. More secure versions of these functions are available, see [strncat_s, _strncat_s_l, wcsncat_s, _wcsncat_s_l, _mbsncat_s, _mbsncat_s_l](strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l.md) .
14
+
Appends characters of a string. More secure versions of these functions are available, see `[strncat_s, _strncat_s_l, wcsncat_s, _wcsncat_s_l, _mbsncat_s, _mbsncat_s_l`](strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l.md) .
16
15
17
16
> [!IMPORTANT]
18
-
> **_mbsncat** and **_mbsncat_l** cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
17
+
> **`_mbsncat`** and **`_mbsncat_l`** cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
19
18
20
19
## Syntax
21
20
@@ -70,16 +69,16 @@ unsigned char *_mbsncat_l(
70
69
71
70
### Parameters
72
71
73
-
*strDest*<br/>
72
+
*`strDest`*\
74
73
Null-terminated destination string.
75
74
76
-
*strSource*<br/>
75
+
*`strSource`*\
77
76
Null-terminated source string.
78
77
79
-
*count*<br/>
78
+
*`count`*\
80
79
Number of characters to append.
81
80
82
-
*locale*<br/>
81
+
*`locale`*\
83
82
Locale to use.
84
83
85
84
## Return Value
@@ -88,39 +87,39 @@ Returns a pointer to the destination string. No return value is reserved to indi
88
87
89
88
## Remarks
90
89
91
-
The **strncat** function appends, at most, the first *count* characters of *strSource* to *strDest*. The initial character of *strSource* overwrites the terminating null character of *strDest*. If a null character appears in *strSource* before *count* characters are appended, **strncat** appends all characters from *strSource*, up to the null character. If *count* is greater than the length of *strSource*, the length of *strSource* is used in place of *count*. The all cases, the resulting string is terminated with a null character. If copying takes place between strings that overlap, the behavior is undefined.
90
+
The **`strncat`** function appends, at most, the first *`count`* characters of *`strSource`* to *`strDest`*. The initial character of *`strSource`* overwrites the terminating null character of *`strDest`*. If a null character appears in *`strSource`* before *`count`* characters are appended, **`strncat`** appends all characters from *`strSource`*, up to the null character. If *`count`* is greater than the length of *`strSource`*, the length of *`strSource`* is used in place of *`count`*. In all cases, the resulting string is terminated with a null character. If copying takes place between strings that overlap, the behavior is undefined.
92
91
93
92
> [!IMPORTANT]
94
-
> **strncat** does not check for sufficient space in *strDest*; it is therefore a potential cause of buffer overruns. Keep in mind that *count* limits the number of characters appended; it is not a limit on the size of *strDest*. See the example below. For more information, see [Avoiding Buffer Overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
93
+
> **`strncat`** does not check for sufficient space in *`strDest`*; it is therefore a potential cause of buffer overruns. Keep in mind that *`count`* limits the number of characters appended; it is not a limit on the size of *`strDest`*. See the example below. For more information, see [Avoiding Buffer Overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
95
94
96
-
**wcsncat** and **_mbsncat** are wide-character and multibyte-character versions of **strncat**. The string arguments and return value of **wcsncat** are wide-character strings; those of **_mbsncat** are multibyte-character strings. These three functions behave identically otherwise.
95
+
**`wcsncat`** and **`_mbsncat`** are wide-character and multibyte-character versions of **`strncat`**. The string arguments and return value of **`wcsncat`** are wide-character strings; those of **`_mbsncat`** are multibyte-character strings. These three functions behave identically otherwise.
97
96
98
-
The output value is affected by the setting of the **LC_CTYPE** category setting of the locale; see [setlocale](setlocale-wsetlocale.md) for more information. The versions of these functions without the **_l** suffix use the current locale for this locale-dependent behavior; the versions with the **_l** suffix are identical except that they use the locale parameter passed in instead. For more information, see [Locale](../../c-runtime-library/locale.md).
97
+
The output value is affected by the setting of the **`LC_CTYPE`** category setting of the locale. For more information, see [`setlocale`](setlocale-wsetlocale.md) for more information. The versions of these functions without the **`_l`** suffix use the current locale for this locale-dependent behavior. The versions with the **`_l`** suffix are identical except they use the locale parameter passed in instead. For more information, see [Locale](../../c-runtime-library/locale.md).
99
98
100
99
In C++, these functions have template overloads. For more information, see [Secure Template Overloads](../../c-runtime-library/secure-template-overloads.md).
101
100
102
101
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
103
102
104
103
### Generic-Text Routine Mappings
105
104
106
-
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
105
+
|`TCHAR.H `routine|`_UNICODE & _MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
> **_strncat_l** and **_wcsncat_l** have no locale dependence and are not meant to be called directly. They are provided for internal use by **_tcsncat_l**.
111
+
> **`_strncat_l`** and **`_wcsncat_l`** have no locale dependence and are not meant to be called directly. They are provided for internal use by **`_tcsncat_l`**.
113
112
114
113
## Requirements
115
114
116
115
|Routine|Required header|
117
116
|-------------|---------------------|
118
-
|**strncat**|\<string.h>|
119
-
|**wcsncat**|\<string.h> or \<wchar.h>|
120
-
|**_mbsncat**|\<mbstring.h>|
121
-
|**_mbsncat_l**|\<mbstring.h>|
117
+
|**`strncat`**|\<string.h>|
118
+
|**`wcsncat`**|\<string.h> or \<wchar.h>|
119
+
|**`_mbsncat`**|\<mbstring.h>|
120
+
|**`_mbsncat_l`**|\<mbstring.h>|
122
121
123
-
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
122
+
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
124
123
125
124
## Example
126
125
@@ -173,16 +172,16 @@ Note that **BadAppend** caused a buffer overrun.
0 commit comments