RTEMS Tools | misc/bin2c/rtems-bin2c.c: Add feature to include license header in generated C files (!58)

Gedare Bloom (@gedare) gitlab at rtems.org
Thu Mar 27 00:40:19 UTC 2025




Gedare Bloom started a new discussion on misc/bin2c/rtems-bin2c.c: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/58#note_121834

 >  }
 >  
 > +char *read_license_file(const char *filename) {
 > +  FILE *file = fopen(filename, "r");
 > +  if (!file) {
 > +    perror("error: could not open license file");
 > +    exit(1);
 > +  }
 > +
 > +  if (fseek(file, 0, SEEK_END) != 0) {
 > +    perror("error: could not seek to end of license file");
 > +    fclose(file);
 > +    exit(1);
 > +  };
 > +
 > +  long length = ftell(file);

declare variables at the start of the scope.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/58#note_121834
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250327/99991a5e/attachment-0001.htm>


More information about the bugs mailing list