forked from Imagelibrary/rtems
2010-07-30 Ralf Corsépius <ralf.corsepius@rtems.org>
* rtems-bin2c.c: Fix memory leak in '.c' suffix strip. Also strip '.h' suffix.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2010-07-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* rtems-bin2c.c: Fix memory leak in '.c' suffix strip.
|
||||
Also strip '.h' suffix.
|
||||
|
||||
2010-07-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* rtems-bin2c.c: Make -v (verbose) working.
|
||||
|
||||
@@ -70,8 +70,12 @@ void process(const char *ifname, const char *ofname)
|
||||
|
||||
strncpy( obasename, ofname, PATH_MAX );
|
||||
len = strlen( obasename );
|
||||
if ( obasename[len-2] == '.' && obasename[len-1] == 'c' )
|
||||
obasename[len-2] = '\0';
|
||||
if ( len >= 2 ) {
|
||||
if ( obasename[len-2] == '.' ) {
|
||||
if ( (obasename[len-1] == 'c') || (obasename[len-1] == 'h') )
|
||||
obasename[len-2] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
sprintf( ocname, "%s.c", obasename );
|
||||
sprintf( ohname, "%s.h", obasename );
|
||||
|
||||
Reference in New Issue
Block a user