1 /// Use strlcpy rather than strncpy(dest,..,sz) + dest[sz-1] = '\0'
5 // Options: --no-includes --include-headers
13 expression dest, src, sz;
17 strncpy@p(dest, src, sz);
20 @script:python depends on org@
24 cocci.print_main("strncpy followed by truncation can be strlcpy",p)
26 @script:python depends on report@
30 msg = "SUGGESTION: strncpy followed by truncation can be strlcpy"
31 coccilib.report.print_report(p[0],msg)
34 expression r.dest, r.src, r.sz;