[rtems commit] Use counted strnlen in bin2c. Closes #2238.
Gedare Bloom
gedare at rtems.org
Mon Feb 23 15:38:44 UTC 2015
Module: rtems
Branch: master
Commit: 1281c34a235fd031352dd43f437d84cf2c8421a7
Changeset: http://git.rtems.org/rtems/commit/?id=1281c34a235fd031352dd43f437d84cf2c8421a7
Author: Gedare Bloom <gedare at rtems.org>
Date: Mon Feb 23 10:38:37 2015 -0500
Use counted strnlen in bin2c. Closes #2238.
---
tools/build/rtems-bin2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/build/rtems-bin2c.c b/tools/build/rtems-bin2c.c
index 391c259..7674389 100644
--- a/tools/build/rtems-bin2c.c
+++ b/tools/build/rtems-bin2c.c
@@ -72,7 +72,7 @@ void process(const char *ifname, const char *ofname)
}
strncpy( obasename, ofname, PATH_MAX );
- len = strlen( obasename );
+ len = strnlen( obasename, PATH_MAX );
if ( len >= 2 ) {
if ( obasename[len-2] == '.' ) {
if ( (obasename[len-1] == 'c') || (obasename[len-1] == 'h') )
More information about the vc
mailing list