Skip to content

Commit 199d108

Browse files
committed
Update comments for code review
1 parent e5ef69a commit 199d108

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform/mbed_retarget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
228228

229229
FileHandle *res = NULL;
230230

231-
/* FILENAME: ":0x12345678" describes a FileHandle* */
231+
/* FILENAME: ":(pointer)" describes a FileHandle* */
232232
if (name[0] == ':') {
233233
void *p;
234234
memcpy(&p, name + 1, sizeof(p));
@@ -826,6 +826,7 @@ void mbed_set_unbuffered_stream(std::FILE *_file) {
826826
*/
827827
std::FILE *mbed_fdopen(FileHandle *fh, const char *mode)
828828
{
829+
// This is to avoid scanf(buf, ":%.4s", fh) and the bloat it brings.
829830
char buf[2 + sizeof(fh) + 1]; /* :(pointer) + null byte */
830831
static_assert(sizeof(buf) == 7, "Pointers should be 4 bytes.");
831832
buf[0] = ':';

0 commit comments

Comments
 (0)