{"id":1472,"date":"2023-08-25T17:49:07","date_gmt":"2023-08-25T16:49:07","guid":{"rendered":"https:\/\/ibex.tech\/c\/?p=1472"},"modified":"2023-08-25T17:50:37","modified_gmt":"2023-08-25T16:50:37","slug":"datetime-issues","status":"publish","type":"post","link":"https:\/\/ibex.tech\/c\/c\/datetime\/datetime-issues","title":{"rendered":"DateTime Issues"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">mktime() causes crashing, memory leak???<\/h4>\n\n\n\n<p>We&#8217;ve found on the ESP32 that using this would cause inexplicable runtime crashing :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tstruct tm Tm1;\n\ttime_t tTime1 ;\n\n\t\/\/...\n\n\ttTime1 = mktime(&amp;Tm1);\t\t\t\/\/&lt;&lt;&lt;&lt;&lt;THIS COULD CAUSE A CRASH!!!<\/code><\/pre>\n\n\n\n<p>Changing the definition to this sovled it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>struct tm Tm1 = {0};\t\/\/&lt;&lt;The = {0} is really important to ensure the struct if properly initialised<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>mktime() causes crashing, memory leak??? We&#8217;ve found on the ESP32 that using this would cause inexplicable runtime crashing : Changing the definition to this sovled it:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[118],"tags":[],"class_list":["post-1472","post","type-post","status-publish","format-standard","hentry","category-datetime"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/comments?post=1472"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1472\/revisions"}],"predecessor-version":[{"id":1476,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1472\/revisions\/1476"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/media?parent=1472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/categories?post=1472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/tags?post=1472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}