Skip to content

printf_P doesn't expand varargs correctly #2819

Closed
@zzeekk

Description

@zzeekk

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions