rszimm / sprinklers_pi

Sprinkling System Control Program for the Raspberry Pi
GNU General Public License v2.0
309 stars 100 forks source link

Problem with AM/PM setting upon Make #182

Open cebab54 opened 3 years ago

cebab54 commented 3 years ago

Hi Nick

When I make sprinklers_pi and the config_h file is NOT set to 24H times (ie as out of the box) it throws the following String error:

settings.h:146:12: note: ‘sprintf’ output between 8 and 11 bytes into a destination of size 10 sprintf(buff, "%d:%.2d %s",

       (h%12 == 0 ? 12 : h%12),
   x%60,
   ~~~~~
   (h < 12 ? "AM" : "PM"));
   ~~~~~~~~~~~~~~~~~~~~~~~

Building target: sprinklers_pi

If I set the Time to the 24HR format in config_h then this error goes away

nhorvath commented 3 years ago

I personally use the AM/PM setting and don't have this issue. What timezone are you in?

nhorvath commented 3 years ago

I don't know why it would say between 8 and 11 bytes either. "00:00 AM" is 8 bytes, I'm not sure how it would become 11 bytes.

nhorvath commented 3 years ago

all this aside, it's a note... not even a warning let alone an error. Is this actually causing an issue with compilation? Please make clean then make and post the whole log.