diff --git a/src/os/src/detail/osTime.c b/src/os/src/detail/osTime.c index 078b9c62d0d49acf17003367811052343f9239a4..44c6a7d74c20e1f7d3fe189b252d21c65101abc3 100644 --- a/src/os/src/detail/osTime.c +++ b/src/os/src/detail/osTime.c @@ -110,10 +110,15 @@ bool checkTzPresent(char *str, int32_t len) { char *seg = forwardToTimeStringEnd(str); int32_t seg_len = len - (int32_t)(seg - str); - return (strnchr(seg, 'Z', seg_len, false) != NULL || - strnchr(seg, 'z', seg_len, false) != NULL || - strnchr(seg, '+', seg_len, false) != NULL || - strnchr(seg, '-', seg_len, false) != NULL); + char *c = &seg[seg_len - 1]; + for (int i = 0; i < seg_len; ++i) { + if (*c == 'Z' || *c == 'z' || *c == '+' || *c == '-') { + return true; + } + c--; + } + return false; + } char* forwardToTimeStringEnd(char* str) {