avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #8228] Added linux spi programmer type based on spidev userspace


From: Joerg Wunsch
Subject: [patch #8228] Added linux spi programmer type based on spidev userspace drivers
Date: Wed, 11 Mar 2020 06:30:45 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Follow-up Comment #3, patch #8228 (project avrdude):

Finally, there's a one warning remaining:


linuxspi.c: In function ‘linuxspi_gpio_op_wr’:
linuxspi.c:170:5: warning: format not a string literal and no format arguments
[-Wformat-security]
     if (fprintf(f, val) < 0)


If I get it correctly, it would not even be necessary to use fprintf here, as
"val" is always a fixed string when being passed to linuxspi_gpio_op_wr(),
correct?

Thus, replacing "fprintf(f, val) < 0" by "fputs(val, f) != EOF" ought to be a
better solution (and avoids the overhead of fprintf trying to interpret a
format string that is known to not have format conversions at all).

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?8228>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]