Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

printf_P doesn't expand varargs correctly #2819

Closed
zzeekk opened this issue Dec 31, 2016 · 0 comments
Closed

printf_P doesn't expand varargs correctly #2819

zzeekk opened this issue Dec 31, 2016 · 0 comments

Comments

@zzeekk
Copy link

zzeekk commented Dec 31, 2016

Basic Infos

Hardware

Hardware: Sparkfun ESP8266
Core Version: master

Description

printf_P doesn't expand varargs correctly:

--- code ---
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
delay(10);
Serial.println("\nSandbox\n");
printf("String %s\n", "Test");
printf_P(PSTR("String %s\n"), "Test");
}

void loop() {
delay(1000);
}

--- output ---
Sandbox
String Test
String

Problem lies on line 237 of pgmspace.cpp (https://github.com/esp8266/Arduino/blob/master/cores/esp8266/pgmspace.cpp#L237)

vprintf should be used instead of printf.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants