summaryrefslogtreecommitdiffstats
path: root/server/parser/pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/parser/pgsql.c')
-rw-r--r--server/parser/pgsql.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/parser/pgsql.c b/server/parser/pgsql.c
index 0483232..44032e5 100644
--- a/server/parser/pgsql.c
+++ b/server/parser/pgsql.c
@@ -811,9 +811,11 @@ int db_register_system(dbconn *dbc, xsltStylesheet *xslt, xmlDoc *summaryxml) {
hostname);
if( ipaddr ) {
- snprintf(sqlq, 4096, " AND ipaddr='%.64s'", ipaddr);
+ append_str(sqlq, "AND ipaddr='", 4028);
+ append_str(sqlq, ipaddr, 4092);
+ append_str(sqlq, "'", 4096);
} else {
- snprintf(sqlq, 4096, " AND ipaddr IS NULL");
+ append_str(sqlq, "%s AND ipaddr IS NULL", 4096);
}
dbres = PQexec(dbc->db, sqlq);