Skip to content

Commit 2a5e6b1

Browse files
TylerMSFTTylerMSFT
andauthored
fix github 2479 (MicrosoftDocs#3308)
* fix github 2479 * escape null * acrolinx Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com>
1 parent 49428d9 commit 2a5e6b1

1 file changed

Lines changed: 34 additions & 33 deletions

File tree

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
title: "_mbsnbcat_s, _mbsnbcat_s_l"
3-
ms.date: "4/2/2020"
2+
title: "`_mbsnbcat_s`, `_mbsnbcat_s_l`"
3+
description: "API description for the Microsoft Visual C++ `_mbsnbcat_s`, and `_mbsnbcat_s_l` functions"
4+
ms.date: "12/2/2020"
45
api_name: ["_mbsnbcat_s_l", "_mbsnbcat_s", "_o__mbsnbcat_s", "_o__mbsnbcat_s_l"]
56
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-multibyte-l1-1-0.dll", "api-ms-win-crt-private-l1-1-0.dll"]
67
api_type: ["DLLExport"]
@@ -9,9 +10,9 @@ f1_keywords: ["_mbsnbcat_s", "mbsnbcat_s", "_mbsnbcat_s_l", "mbsnbcat_s_l"]
910
helpviewer_keywords: ["_tcsncat function", "mbsnbcat_s function", "_mbsnbcat_s function", "_mbsnbcat_s_l function", "_tcsncat_s_l function", "tcsncat_s_l function", "mbsnbcat_s_l function", "tcsncat function"]
1011
ms.assetid: 2c9e9be7-d979-4a54-8ada-23428b6648a9
1112
---
12-
# _mbsnbcat_s, _mbsnbcat_s_l
13+
# `_mbsnbcat_s`, `_mbsnbcat_s_l`
1314

14-
Appends to a multibyte character string, at most, the first **n** bytes of another multibyte-character string. These are versions of [_mbsnbcat, _mbsnbcat_l](mbsnbcat-mbsnbcat-l.md) that have security enhancements, as described in [Security Features in the CRT](../../c-runtime-library/security-features-in-the-crt.md).
15+
Appends to a multibyte character string, at most, the first **n** bytes of another multibyte-character string. These are versions of [`_mbsnbcat`, `_mbsnbcat_l`](mbsnbcat-mbsnbcat-l.md) that have security enhancements, as described in [Security Features in the CRT](../../c-runtime-library/security-features-in-the-crt.md).
1516

1617
> [!IMPORTANT]
1718
> This API 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).
@@ -49,19 +50,19 @@ errno_t _mbsnbcat_s_l(
4950

5051
### Parameters
5152

52-
*dest*<br/>
53+
*`dest`*\
5354
Null-terminated multibyte-character destination string.
5455

55-
*sizeInBytes*<br/>
56-
Size of the *dest* buffer in bytes.
56+
*`sizeInBytes`*\
57+
Size of the *`dest`* buffer in bytes.
5758

58-
*src*<br/>
59+
*`src`*\
5960
Null-terminated multibyte-character source string.
6061

61-
*count*<br/>
62-
Number of bytes from *src* to append to *dest*.
62+
*`count`*\
63+
Number of bytes from *`src`* to append to *`dest`*.
6364

64-
*locale*<br/>
65+
*`locale`*\
6566
Locale to use.
6667

6768
## Return Value
@@ -70,49 +71,49 @@ Zero if successful; otherwise, an error code.
7071

7172
### Error Conditions
7273

73-
|**Dest**|*sizeInBytes*|*src*|Return value|
74+
|**`dest`**|*`sizeInBytes`*|*`src`*|Return value|
7475
|------------|-------------------|-----------|------------------|
75-
|**NULL**|any|any|**EINVAL**|
76-
|Any|<= 0|any|**EINVAL**|
77-
|Any|any|**NULL**|**EINVAL**|
76+
|**`NULL`**|any|any|**`EINVAL`**|
77+
|Any|<= 0|any|**`EINVAL`**|
78+
|Any|any|**`NULL`**|**`EINVAL`**|
7879

79-
If any of the error conditions occurs, the function generates an invalid parameter error, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If the error is handled, the function returns **EINVAL** and sets **errno** to **EINVAL**.
80+
If any of the error conditions occurs, the function generates an invalid parameter error, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If the error is handled, the function returns **`EINVAL`** and sets **errno** to **`EINVAL`**.
8081

8182
## Remarks
8283

83-
The **_mbsnbcat_s** function appends to *dest*, at most, the first *count* bytes of *src*. If the byte that immediately precedes the null character in *dest* is a lead byte, it is overwritten by the initial byte of *src*. Otherwise, the initial byte of *src* overwrites the terminating null character of *dest*. If a null byte appears in *src* before *count* bytes are appended, **_mbsnbcat_s** appends all bytes from *src*, up to the null character. If *count* is greater than the length of *src*, the length of *src* is used in place of *count*. The resulting string is terminated by a null character. If copying takes place between strings that overlap, the behavior is undefined.
84+
The **`_mbsnbcat_s`** function appends to *`dest`*, at most, the first *`count`* bytes of *`src`*. If the byte that immediately precedes the null character in *`dest`* is a lead byte, it's overwritten by the initial byte of *`src`*. Otherwise, the initial byte of *`src`* overwrites the terminating null character of *`dest`*. If a null byte appears in *`src`* before *`count`* bytes are appended, **`_mbsnbcat_s`** appends all bytes from *`src`*, up to the null character. If *`count`* is greater than the length of *`src`*, the length of *`src`* is used in place of *`count`*. The resulting string is terminated by a null character. If copying takes place between strings that overlap, the behavior is undefined.
8485

85-
The output value is affected by the setting of the **LC_CTYPE** category setting of the locale; see [setlocale, _wsetlocale](setlocale-wsetlocale.md) for more information. The versions of these functions are identical, except that the ones that don't have the **_l** suffix use the current locale and the ones that do have the **_l** suffix instead use the locale parameter that's passed in. For more information, see [Locale](../../c-runtime-library/locale.md).
86+
The output value is affected by the setting of the **`LC_CTYPE`** category setting of the locale; see [setlocale, _wsetlocale](setlocale-wsetlocale.md) for more information. The versions of these functions are identical, except that the ones that don't have the **`_l`** suffix use the current locale and the ones that do have the **`_l`** suffix instead use the locale parameter that's passed in. For more information, see [Locale](../../c-runtime-library/locale.md).
8687

87-
In C++, the use of these functions is simplified by template overloads; the overloads can infer buffer length automatically and thereby eliminate the need to specify a size argument, and they can automatically use their newer, more secure functions to replace older, less-secure functions. For more information, see [Secure Template Overloads](../../c-runtime-library/secure-template-overloads.md).
88+
In C++, the use of these functions is simplified by template overloads. The overloads can infer buffer length automatically which eliminates the need to specify a size argument, and they can automatically use their newer, more secure functions to replace older, less-secure functions. For more information, see [Secure Template Overloads](../../c-runtime-library/secure-template-overloads.md).
8889

89-
The debug library versions of these functions first fill the buffer with 0xFE. To disable this behavior, use [_CrtSetDebugFillThreshold](crtsetdebugfillthreshold.md).
90+
The debug library versions of these functions first fill the buffer with 0xFE. To disable this behavior, use [`_CrtSetDebugFillThreshold`](crtsetdebugfillthreshold.md).
9091

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

9394
### Generic-Text Routine Mappings
9495

95-
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
96+
|`Tchar.h` routine|`_UNICODE` and `_MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
9697
|---------------------|--------------------------------------|--------------------|-----------------------|
97-
|**_tcsncat**|[strncat](strncat-strncat-l-wcsncat-wcsncat-l-mbsncat-mbsncat-l.md)|**_mbsnbcat_s**|[wcsncat](strncat-strncat-l-wcsncat-wcsncat-l-mbsncat-mbsncat-l.md)|
98-
|**_tcsncat_s_l**|**_strncat_s_l**|**_mbsnbcat_s_l**|**_wcsncat_s_l**|
98+
|**`_tcsncat_s`**|[strncat_s](strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l.md)|**`_mbsnbcat_s`**|[wcsncat_s](strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l.md)|
99+
|**`_tcsncat_s_l`**|**`_strncat_s_l`**|**`_mbsnbcat_s_l`**|**`_wcsncat_s_l`**|
99100

100101
## Requirements
101102

102103
|Routine|Required header|
103104
|-------------|---------------------|
104-
|**_mbsnbcat_s**|\<mbstring.h>|
105-
|**_mbsnbcat_s_l**|\<mbstring.h>|
105+
|**`_mbsnbcat_s`**|\<mbstring.h>|
106+
|**`_mbsnbcat_s_l`**|\<mbstring.h>|
106107

107108
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
108109

109110
## See also
110111

111-
[String Manipulation](../../c-runtime-library/string-manipulation-crt.md)<br/>
112-
[_mbsnbcmp, _mbsnbcmp_l](mbsnbcmp-mbsnbcmp-l.md)<br/>
113-
[_strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l](strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md)<br/>
114-
[_mbsnbcpy, _mbsnbcpy_l](mbsnbcpy-mbsnbcpy-l.md)<br/>
115-
[_mbsnbcpy_s, _mbsnbcpy_s_l](mbsnbcpy-s-mbsnbcpy-s-l.md)<br/>
116-
[_mbsnbset, _mbsnbset_l](mbsnbset-mbsnbset-l.md)<br/>
117-
[strncat, _strncat_l, wcsncat, _wcsncat_l, _mbsncat, _mbsncat_l](strncat-strncat-l-wcsncat-wcsncat-l-mbsncat-mbsncat-l.md)<br/>
118-
[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)<br/>
112+
[String Manipulation](../../c-runtime-library/string-manipulation-crt.md)\
113+
[`_mbsnbcmp`, `_mbsnbcmp_l`](mbsnbcmp-mbsnbcmp-l.md)\
114+
[`_strncnt`, `_wcsncnt`, `_mbsnbcnt`, `_mbsnbcnt_l`, `_mbsnccnt`, `_mbsnccnt_l`](strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md)\
115+
[`_mbsnbcpy`, `_mbsnbcpy_l`](mbsnbcpy-mbsnbcpy-l.md)\
116+
[`_mbsnbcpy_s`, `_mbsnbcpy_s_l`](mbsnbcpy-s-mbsnbcpy-s-l.md)\
117+
[`_mbsnbset`, `_mbsnbset_l`](mbsnbset-mbsnbset-l.md)\
118+
[`strncat`, `_strncat_l`, `wcsncat`, `_wcsncat_l`, `_mbsncat`, `_mbsncat_l`](strncat-strncat-l-wcsncat-wcsncat-l-mbsncat-mbsncat-l.md)\
119+
[`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)

0 commit comments

Comments
 (0)