Skip to content

Commit 7d270e7

Browse files
Updated C6272
Removed extra characters, fixed example
1 parent 8ddcba9 commit 7d270e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/code-quality/c6272.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.assetid: b63937ac-fbb2-45ec-936a-641c156e6355
99
---
1010
# Warning C6272
1111

12-
> Non-float passed as argument '\**number*' when float is required in call to '\**function-name*'
12+
> Non-float passed as argument '*number*' when float is required in call to '*function-name*'
1313
1414
This warning indicates that the format string specifies that a float is required, for example, a `%f` or `%g` specification for `printf,` but a non-float such as an integer or string is being passed.
1515

@@ -28,7 +28,7 @@ void f()
2828
{
2929
char buff[5];
3030
int i=5;
31-
sprintf_s(buff, "%s %f", "a", i);
31+
sprintf_s(buff, sizeof(buff), "%s %f", "a", i);
3232
}
3333
```
3434

@@ -39,6 +39,6 @@ void f()
3939
{
4040
char buff[5];
4141
int i=5;
42-
sprintf_s(buff, "%s %i", "a", i);
42+
sprintf_s(buff, sizeof(buff), "%s %i", "a", i);
4343
}
4444
```

0 commit comments

Comments
 (0)