Messages in this thread | | | Date | Fri, 13 Jul 2018 06:50:13 -0400 (EDT) | From | Julia Lawall <> | Subject | Re: [Cocci] [PATCH 01/18] coccinelle: change strncpy+truncation to strlcpy |
| |
For the file drivers/net/wireless/ti/wl1251/acx.c, the following keeps the comment before the buf update and moves the strlcpy call below it. It does however drop the comment just before the original call to strncpy.
julia
@r@ expression dest, src; expression f; @@
- strncpy(dest,src,f); dest[f - 1] = '\0' + + strlcpy(dest,src,f) ;
@@ expression r.dest, r.src; expression r.f; @@
- dest[f - 1] = '\0' + strlcpy(dest,src,f); + strlcpy(dest,src,f);
| |