Fixed bug in string format when translating TIME and DATETIME to STRING
authorLaurent Bessard
Mon, 11 Mar 2013 12:51:01 +0100
changeset 803 36ac3a58be39
parent 802 cac262d1d6a5
child 804 7898ba56c7cf
Fixed bug in string format when translating TIME and DATETIME to STRING
lib/iec_std_lib.h
--- a/lib/iec_std_lib.h	Mon Mar 11 12:49:33 2013 +0100
+++ b/lib/iec_std_lib.h	Mon Mar 11 12:51:01 2013 +0100
@@ -604,7 +604,7 @@
                  broken_down_time.tm_min,
                  broken_down_time.tm_sec);
     }else{
-        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%09.6g",
+        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%09.6f",
                  broken_down_time.tm_hour,
                  broken_down_time.tm_min,
                  (LREAL)broken_down_time.tm_sec + (LREAL)IN.tv_nsec / 1e9);
@@ -626,7 +626,7 @@
                  broken_down_time.tm_min,
                  broken_down_time.tm_sec);
     }else{
-        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%09.6g",
+        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%09.6f",
                  broken_down_time.tm_year,
                  broken_down_time.tm_mon,
                  broken_down_time.tm_day,