eclipse / upm

UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
MIT License
661 stars 410 forks source link

examples: gcc8 fixes for -Werror=format-truncation #663

Closed b49020 closed 6 years ago

b49020 commented 6 years ago

Fixes below issues: tm1637.cxx:69:29: error: "%2d%02d" directive output may be truncated writing between 5 and 15 bytes into a destination of size 5 [-Werror=format-truncation=] snprintf(myTime, 5, "%2d%02d", (hour + timezone + 24) % 24, min);

jhd1313m1.c:65:49: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=] snprintf(str, sizeof(str), "Hello World %d", ndx);

Signed-off-by: Sumit Garg sumit.garg@linaro.org

Propanu commented 6 years ago

Merged 6ae7e9125b93a9ce9692749caca3d254d7127c9d, thanks much!