Increased nenory for the nodes query strings.

Thu, 04 Oct 2018 22:50:40 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 04 Oct 2018 22:50:40 +0200
changeset 76
804d45bdaa86
parent 75
1a3c6480e057
child 77
a9f8de2d7b2b

Increased nenory for the nodes query strings.

bmsd/mysql.c file | annotate | diff | comparison | revisions
--- a/bmsd/mysql.c	Tue Oct 02 22:23:52 2018 +0200
+++ b/bmsd/mysql.c	Thu Oct 04 22:50:40 2018 +0200
@@ -324,7 +324,7 @@
 
 void node_mysql_insert(sys_node_list *node)
 {
-    char	*query = malloc(512), first[21], last[21];
+    char	*query = malloc(1024), first[21], last[21];
     struct tm	*mytime;
 
     mytime = localtime(&node->firstseen);
@@ -334,7 +334,7 @@
     snprintf(last, 20, "%04d-%02d-%02d %02d:%02d:%02d",
 		mytime->tm_year + 1900, mytime->tm_mon + 1, mytime->tm_mday, mytime->tm_hour, mytime->tm_min, mytime->tm_sec);
 
-    snprintf(query, 511,
+    snprintf(query, 1023,
 	"INSERT INTO  mon_nodes SET uuid='%s', node='%s', online='%s', group_id='%s', " \
         "hardwaremake='%s', hardwaremodel='%s', os='%s', os_version='%s', firmware='%s', firstseen='%s', lastseen='%s', " \
 	"temperature='%.3f', humidity='%.3f', barometer='%.3f', gps_latitude='%.8f', gps_longitude='%.8f', gps_altitude='%.8f', " \
@@ -357,14 +357,14 @@
 
 void node_mysql_update(sys_node_list *node)
 {
-    char        *query = malloc(512), last[21];
+    char        *query = malloc(1024), last[21];
     struct tm   *mytime;
 
     mytime = localtime(&node->lastseen);
     snprintf(last, 20, "%04d-%02d-%02d %02d:%02d:%02d",
     	mytime->tm_year + 1900, mytime->tm_mon + 1, mytime->tm_mday, mytime->tm_hour, mytime->tm_min, mytime->tm_sec);
 
-    snprintf(query, 511,
+    snprintf(query, 1023,
 	"UPDATE mon_nodes SET online='%s', hardwaremake='%s', hardwaremodel='%s', os='%s', os_version='%s', firmware='%s', lastseen='%s', " \
 	"temperature='%.3f', humidity='%.3f', barometer='%.3f', gps_latitude='%.8f', gps_longitude='%.8f', gps_altitude='%.8f', " \
 	"net_address='%s', net_ifname='%s', net_rssi='%d' WHERE uuid='%s'",

mercurial