]> git.feebdaed.xyz Git - 0xmirror/WiringPi.git/commitdiff
Merge branch 'develop' into pwm
authorManfred Wallner <mwallner@users.noreply.github.com>
Fri, 3 May 2024 19:27:49 +0000 (21:27 +0200)
committerGitHub <noreply@github.com>
Fri, 3 May 2024 19:27:49 +0000 (21:27 +0200)
1  2 
gpio/gpio.c
wiringPi/wiringPi.c

diff --cc gpio/gpio.c
index 1e7ec59a2e2449dd44c660bcd3e6066264a2e7e4,86b1a42371e4af3146a1899116b10dcf0f996458..84b3bb00d31832bbe4f228066d940995a89c6146
@@@ -1371,9 -1410,12 +1410,12 @@@ static void doVersion (char *argv []
    {
      if ((fd = fopen ("/proc/device-tree/model", "r")) != NULL)
      {
-       fgets (name, 80, fd) ;
+       if (fgets(name, sizeof(name), fd) == NULL) {
+         // Handle error or end of file condition
+         perror("Error reading /proc/device-tree/model");
+       }
        fclose (fd) ;
 -      printf ("  *--> %s\n", name) ;
 +      printf ("      Model: %s\n", name) ;
      }
    }
  
Simple merge