summaryrefslogtreecommitdiffstats
path: root/src/plugins/influxdb.h
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2019-07-09 00:18:08 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2019-08-01 17:46:23 +0200
commit7b5953e7d5c8c51f5315e677781d1b46be33b240 (patch)
tree2fab6ac4b6947f76230b14aa3065502104d7211e /src/plugins/influxdb.h
parent903b0e9a002e0839943c5d734f3728114272ebc1 (diff)
Fix strings quoting
Change-Id: If7226a1c4692c262e82bc77b2bb62a5487227ab3 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'src/plugins/influxdb.h')
-rw-r--r--src/plugins/influxdb.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/influxdb.h b/src/plugins/influxdb.h
index 33eb0a2..54af5fc 100644
--- a/src/plugins/influxdb.h
+++ b/src/plugins/influxdb.h
@@ -111,20 +111,22 @@ static inline void concatenate(char* dest, const char* source, const char* sep)
free(esc_source);
}
-static inline void concatenate_str(char* dest, const char* source, const char* sep)
+static inline void concatenate_str(char* dest, const char* source, const char* sep, bool quoteString)
{
char* esc_source;
if (sep)
strncat(dest, sep, strlen(sep));
- strncat(dest, "\"", 1);
+ if (quoteString)
+ strncat(dest, "\"", 2);
esc_source = escape_chr(source, TRUE);
strncat(dest, esc_source, strlen(esc_source));
if (esc_source)
free(esc_source);
- strncat(dest, "\"", 1);
+ if (quoteString)
+ strncat(dest, "\"", 2);
}
extern size_t make_url_db(char* url, size_t l_url, const char* host, const char* port, const char* endpoint, const char *db);