]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/postgresql/postgresql_store_utils.cpp
Ticket 37. if (year < 1990) checking added in the ts2time() function.
[stg.git] / projects / stargazer / plugins / store / postgresql / postgresql_store_utils.cpp
index 9a5101e121c04a605e1698f08305445e31687818..9845242991ab5e1f91f1706dffd6ab490adb5db9 100644 (file)
  *
  */
 
-#include "postgresql_store.h"
-
-#include "stg/common.h"
-
 #include <string>
 #include <ctime>
 
 #include <libpq-fe.h>
 
+#include "stg/common.h"
+#include "postgresql_store.h"
+
 extern volatile time_t stgTime;
 
 int POSTGRESQL_STORE::StartTransaction() const
@@ -94,10 +93,10 @@ int error = 0;
 char * buf = new char[(value.length() << 1) + 1];
 
 PQescapeStringConn(connection,
-                   buf,
-                   value.c_str(),
-                   value.length(),
-                   &error);
+                  buf,
+                  value.c_str(),
+                  value.length(),
+                  &error);
 
 if (error)
     {
@@ -132,6 +131,8 @@ if (year)
 else
     {
     time_t curTime = stgTime;
+    /*time(&curTime);*/
+
     localtime_r(&curTime, &brokenTime);
     }
 
@@ -143,3 +144,4 @@ strftime(buf, 32, "%Y-%m-%d", &brokenTime);
 
 date = buf;
 }
+