Use counted strnlen in bin2c. Closes #2238.

This commit is contained in:
Gedare Bloom
2015-02-23 10:38:37 -05:00
parent 83fe4468bc
commit 1281c34a23

View File

@@ -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') )