diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index d793f30904..351a941ab4 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -228,7 +228,7 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) { FileHandle *res = NULL; - /* FILENAME: ":0x12345678" describes a FileHandle* */ + /* FILENAME: ":(pointer)" describes a FileHandle* */ if (name[0] == ':') { void *p; memcpy(&p, name + 1, sizeof(p)); @@ -826,6 +826,7 @@ void mbed_set_unbuffered_stream(std::FILE *_file) { */ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode) { + // This is to avoid scanf(buf, ":%.4s", fh) and the bloat it brings. char buf[2 + sizeof(fh) + 1]; /* :(pointer) + null byte */ static_assert(sizeof(buf) == 7, "Pointers should be 4 bytes."); buf[0] = ':';