rafael2k / isdbt-capture

ISDB-T capture: A ISDB-T International capture app compatible with DVB v5 Linux API and ITU Region II and Japan channels.
http://www.telemidia.puc-rio.br/~rafaeldiniz/isdbt-capture/
GNU General Public License v3.0
14 stars 4 forks source link

bug: some format-overflow warnings #3

Open RodrigoDornelles opened 1 month ago

RodrigoDornelles commented 1 month ago

estou trabalhando na #2, e acabei percebendo que existe alguns warnings, posso também corrigilos em mandar em PR a parte. alias qual o estilo de identação seguido? seria GNU?

dvb_resource.c: In function ‘dvbres_listdevices’:
dvb_resource.c:86:29: warning: ‘/frontend0’ directive writing 10 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
   86 |       sprintf(frontname, "%s/frontend0", adaptername);
      |                             ^~~~~~~~~~
dvb_resource.c:86:7: note: ‘sprintf’ output between 11 and 138 bytes into a destination of size 128
   86 |       sprintf(frontname, "%s/frontend0", adaptername);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dvb_resource.c: In function ‘dvbres_open’:
dvb_resource.c:211:29: warning: ‘/frontend0’ directive writing 10 bytes into a region of size between 1 and 64 [-Wformat-overflow=]
  211 |         sprintf(devname, "%s/frontend0", devprefix);
      |                             ^~~~~~~~~~
dvb_resource.c:211:9: note: ‘sprintf’ output between 11 and 74 bytes into a destination of size 64
  211 |         sprintf(devname, "%s/frontend0", devprefix);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dvb_resource.c:185:33: warning: ‘/frontend0’ directive writing 10 bytes into a region of size between 1 and 64 [-Wformat-overflow=]
  185 |             sprintf(devname, "%s/frontend0", devprefix);
      |                                 ^~~~~~~~~~
dvb_resource.c:185:13: note: ‘sprintf’ output between 11 and 74 bytes into a destination of size 64
  185 |             sprintf(devname, "%s/frontend0", devprefix);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dvb_resource.c:318:25: warning: ‘/demux0’ directive writing 7 bytes into a region of size between 1 and 64 [-Wformat-overflow=]
  318 |     sprintf(devname, "%s/demux0", devprefix);
      |                         ^~~~~~~
dvb_resource.c:318:5: note: ‘sprintf’ output between 8 and 71 bytes into a destination of size 64
  318 |     sprintf(devname, "%s/demux0", devprefix);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dvb_resource.c:341:25: warning: ‘/dvr0’ directive writing 5 bytes into a region of size between 1 and 64 [-Wformat-overflow=]
  341 |     sprintf(devname, "%s/dvr0", devprefix);
      |                         ^~~~~
dvb_resource.c:341:5: note: ‘sprintf’ output between 6 and 69 bytes into a destination of size 64
  341 |     sprintf(devname, "%s/dvr0", devprefix);
RodrigoDornelles commented 1 month ago

@rafael2k na real, posso fazer um checkup no projeto, como fazer CI/CD, mover buffers da stack para global, colocar linter, teste de identação, teste de memoria. colocar .gitignore e explicar mais coisas na README.md