temp_len = SAFE_SNPRINTF(&query, &query_size, len, " OR ");
if (0 <= temp_len)
len += temp_len;
+
+ } else {
+ temp_len = SAFE_SNPRINTF(&query, &query_size, len, "SELECT * FROM ");
+ if (0 <= temp_len)
+ len += temp_len;
+ temp_len = SAFE_SNPRINTF(&query, &query_size, len, table);
+ if (0 <= temp_len)
+ len += temp_len;
+ temp_len = SAFE_SNPRINTF(&query, &query_size, len, " WHERE ");
+ if (0 <= temp_len)
+ len += temp_len;
}
+
snprintf(temp_query, sizeof(temp_query), "person_id IN (SELECT person_id "
"FROM "CTS_TABLE_CONTACTS" WHERE deleted = 0 AND contact_id ");
temp_len = SAFE_SNPRINTF(&query, &query_size, len, temp_query);