Skip to content

Commit 1ebdfed

Browse files
Updated C28159
Removed duplicate lines
1 parent 4968532 commit 1ebdfed

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

docs/code-quality/c28159.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
---
22
description: "Learn more about: C28159"
33
title: C28159
4-
ms.date: 11/04/2016
54
ms.date: 09/08/2022
65
ms.topic: reference
7-
f1_keywords: ["C28159"]
86
f1_keywords: ["C28159", "USE_OTHER_FUNCTION", "__WARNING_USE_OTHER_FUNCTION"]
97
helpviewer_keywords: ["C28159"]
108
ms.assetid: fab6cd58-0985-4ef6-89a2-64ed04297437
119
---
12-
# C28159
1310
# Warning C28159
1411

15-
> warning C28159: Consider using another function instead.
1612
> Consider using `\**function_name_1*` instead of `\**function_name_2*`. Reason: `\**reason*`
17-
This warning is reported for Drivers is suggesting that you use a preferred function call that is semantically equivalent to the function that the driver is calling. This is a general warning message; the annotation `__drv_preferredFunction` was used (possibly with a conditional a `__drv_when`() annotation) to flag a bad coding practice.
13+
1814
This warning occurs when that you use a function that is semantically equivalent to an alternative, preferred function call.
1915

2016
## Remarks
@@ -25,15 +21,13 @@ Code analysis name: USE_OTHER_FUNCTION
2521

2622
## Example
2723

28-
The following code example generates this warning:
2924
The following code example generates this warning. This issue is due to the use of `OemToChar`, which does not validate the buffer size:
3025

3126
```cpp
3227
char buff[MAX_PATH];
3328
OemToChar(buff, input); // If strlen(input) > MAX_PATH, this call leads to buffer overrun
3429
```
3530
36-
The following code example avoids this warning:
3731
The following code example avoids this warning by using the recommended alternative `OemToCharBuff`, which takes in the destination buffer size and limits the copy appropriatly:
3832
3933
```cpp

0 commit comments

Comments
 (0)