![]() |
![]() |
2847 | ![]() |
||||
![]() | |||||||
| Arrays | |||||||
An apparent anomaly has been detected. Certain standard library functions specify a maximum number (M) of characters to be written to a char array (A).
| function | A parameter number | M parameter number |
|---|---|---|
| asctime_s | 1 | 2 |
| ctime_s | 1 | 2 |
| snprintf | 1 | 2 |
| snprintf_s | 1 | 2 |
| strcpy_s | 1 | 2 |
| strncat | 1 | 3 |
| strncat_s | 1 | 2 |
| strncat_s | 1 | 4 |
| strncat_s | 3 | 4 |
| strncpy | 1 | 3 |
| strncpy_s | 1 | 4 |
/*PRQA S 1-9999 ++*/
/*PRQA S 2847 --*/
#include <string.h>
extern char a[10];
extern char b[11];
void foo (int m)
{
if (m > sizeof (a))
{
}
strncpy (a, b, m); /* 2847 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |