Fix __dt_to_string primitive function.
authorConti Manuele <manuele.conti@alice.it>
Wed, 02 May 2012 14:46:48 +0200
changeset 538 06cc7500500d
parent 537 199bdfe36166
child 539 1ff26534a54f
Fix __dt_to_string primitive function.
lib/iec_std_lib.h
--- a/lib/iec_std_lib.h	Tue Apr 24 16:49:43 2012 +0200
+++ b/lib/iec_std_lib.h	Wed May 02 14:46:48 2012 +0200
@@ -568,16 +568,16 @@
     }
     if(IN.tv_nsec == 0){
         res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%d",
-                 broken_down_time->tm_year,
-                 broken_down_time->tm_mon,
+                 broken_down_time->tm_year + 1900,
+                 broken_down_time->tm_mon  + 1,
                  broken_down_time->tm_mday,
                  broken_down_time->tm_hour,
                  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:%g",
-                 broken_down_time->tm_year,
-                 broken_down_time->tm_mon,
+                 broken_down_time->tm_year + 1900,
+                 broken_down_time->tm_mon  + 1,
                  broken_down_time->tm_mday,
                  broken_down_time->tm_hour,
                  broken_down_time->tm_min,