Index: lib/sdk/crt/stdio/stat.c =================================================================== --- lib/sdk/crt/stdio/stat.c (revision 58638) +++ lib/sdk/crt/stdio/stat.c (working copy) @@ -1,6 +1,7 @@ #include #include - +/*BEWARE: This macro expands to MULTIPLE lines. +/*Macro will lead to undesired behaviors in one-lined loops/ifs these are not properly bracketed*/ #define stat64_to_stat(buf64, buf) \ buf->st_dev = (buf64)->st_dev; \ buf->st_ino = (buf64)->st_ino; \ @@ -21,7 +22,9 @@ ret = _tstat64(path, &buf64); if (!ret) + { stat64_to_stat(&buf64, buf); + } return ret; } @@ -32,7 +35,9 @@ ret = _tstat64(path, &buf64); if (!ret) + { stat64_to_stat(&buf64, buf); + } return ret; } @@ -44,7 +49,9 @@ ret = _fstat64(fd, &buf64); if (!ret) + { stat64_to_stat(&buf64, buf); + } return ret; } @@ -55,7 +62,9 @@ ret = _fstat64(fd, &buf64); if (!ret) + { stat64_to_stat(&buf64, buf); + } return ret; }