Changeset 49fb1c50 in rtems


Ignore:
Timestamp:
Jul 30, 2010, 12:44:32 PM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
a46e6b6d
Parents:
b3ef1322
Message:

2010-07-30 Ralf Corsépius <ralf.corsepius@…>

  • rtems-bin2c.c: Fix memory leak in '.c' suffix strip. Also strip '.h' suffix.
Location:
tools/build
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/build/ChangeLog

    rb3ef1322 r49fb1c50  
     12010-07-30      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * rtems-bin2c.c: Fix memory leak in '.c' suffix strip.
     4        Also strip '.h' suffix.
     5
    162010-07-30      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • tools/build/rtems-bin2c.c

    rb3ef1322 r49fb1c50  
    7171  strncpy( obasename, ofname, PATH_MAX );
    7272  len = strlen( obasename );
    73   if ( obasename[len-2] == '.' && obasename[len-1] == 'c' )
    74     obasename[len-2] = '\0';
     73  if ( len >= 2 ) {
     74    if ( obasename[len-2] == '.' ) {
     75      if ( (obasename[len-1] == 'c') || (obasename[len-1] == 'h') )
     76        obasename[len-2] = '\0';
     77    }
     78  }
    7579
    7680  sprintf( ocname, "%s.c", obasename );
Note: See TracChangeset for help on using the changeset viewer.