Compiler Error #5
FrankyBBillions
started this conversation in
General
Replies: 1 comment 1 reply
-
Hello Frank, thank you for your message. My idea was to ensure that there is a null at the end of the new created string because I was not sure if that was generated automatically by sprintf.
With memset the buffer will be reset and the \0 can be removed. Hope this helps. Best regards, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Marcel,
Arduino: 1.8.13 (Windows 7), Board: "ESP32 Dev Module, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 115200, Verbose"And thank you for this project, I have completed the hardware assembly and having trouble compiling the code as below. I look forward to your guidance, thanks in advance.
sprintf(statusMsg, "%s: %0.2f\0", descr, value);
sprintf(statusMsg, "%s: %d\0", descr, value);
sprintf(statusMsg, "%s\0", text);
exit status 1
embedded '\0' in format [-Werror=format-contains-nul]
Please excuse my ignorance if I have overlooked something, I’m an old guy but relatively new to coding.
Take Care,
Frank
Beta Was this translation helpful? Give feedback.
All reactions