I think I found a small bug in date_time.c

Am I correct?

burt@P51:~/ncs/v3.1.1/nrf/lib/date_time$ git diff .
diff --git a/lib/date_time/date_time.c b/lib/date_time/date_time.c
index 495b2a6123..f6267e299a 100644
--- a/lib/date_time/date_time.c
+++ b/lib/date_time/date_time.c
@@ -132,7 +132,7 @@ int date_time_now_local(int64_t *local_time_ms)
                LOG_ERR("The passed in pointer cannot be NULL");
                return -EINVAL;
        }
-       if (!date_time_is_valid()) {
+       if (!date_time_is_valid_local()) {
                LOG_WRN("Valid time not currently available");
                return -ENODATA;
        }

Burt
Parents
  • Hi,

    Thanks for reaching out to us, it is highly appreciated!

    I do agree it looks a bit suspicious, yes.

    Looking at the code, the difference doesn't seem that large in practice (it only seems to affect what error codes are returned in some situations,) but we will look into it anyway to see if it should be changed.

    Thanks again for reporting!

    Regards,
    Terje

Reply
  • Hi,

    Thanks for reaching out to us, it is highly appreciated!

    I do agree it looks a bit suspicious, yes.

    Looking at the code, the difference doesn't seem that large in practice (it only seems to affect what error codes are returned in some situations,) but we will look into it anyway to see if it should be changed.

    Thanks again for reporting!

    Regards,
    Terje

Children
Related