summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-05-03 03:08:20 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-05-03 17:58:43 +0300
commite0318c4776549a0db0a06682e906310970c8caf9 (patch)
tree9cb6f87b00ed4baad070952071e7597ac0d9e4d1
parent7235248d38434f4c3e8a163ab03637ac115bdda8 (diff)
libcamera: utils: Avoid infinite recursion with strtod()
When the C library doesn't provide local object support, the utils::strtod() function simply calls strtod() from the C library. The current implementation does so incorrectly, and calls utils::strtod() instead, resulting in infinite recursion. Fix it with a proper namespace qualifier. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
-rw-r--r--src/libcamera/base/utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/base/utils.cpp b/src/libcamera/base/utils.cpp
index 2f4c3177..96023f99 100644
--- a/src/libcamera/base/utils.cpp
+++ b/src/libcamera/base/utils.cpp
@@ -517,7 +517,7 @@ double strtod(const char *__restrict nptr, char **__restrict endptr)
* If the libc implementation doesn't provide locale object support,
* assume that strtod() is locale-independent.
*/
- return strtod(nptr, endptr);
+ return ::strtod(nptr, endptr);
#endif
}