The following commit has been merged in the master branch: commit 4d7a398d35143de4a3316b5908b87c31045e7fe2 Author: Michal Čihař <mci...@novell.com> Date: Thu Mar 3 13:29:49 2011 +0100
Do not pass not needed parameter diff --git a/smsd/services/dbi.c b/smsd/services/dbi.c index 75cbd6a..6c03fb8 100644 --- a/smsd/services/dbi.c +++ b/smsd/services/dbi.c @@ -283,10 +283,10 @@ int SMSDDBI_NextRow(GSM_SMSDConfig * Config, SQL_result *res) return dbi_result_next_row(res->dbi); } /* quote strings */ -char * SMSDDBI_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char *string) +char * SMSDDBI_QuoteString(GSM_SMSDConfig * Config, const char *string) { char *encoded_text = NULL; - dbi_conn_quote_string_copy(conn->dbi, string, &encoded_text); + dbi_conn_quote_string_copy(Config->conn.dbi, string, &encoded_text); return encoded_text; } /* LAST_INSERT_ID */ diff --git a/smsd/services/mysql.c b/smsd/services/mysql.c index bfff893..743960e 100644 --- a/smsd/services/mysql.c +++ b/smsd/services/mysql.c @@ -154,7 +154,7 @@ int SMSDMySQL_NextRow(GSM_SMSDConfig * Config, SQL_result *res) } /* quote strings */ -char * SMSDMySQL_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char *string) +char * SMSDMySQL_QuoteString(GSM_SMSDConfig * Config, const char *string) { char *buff; int len = strlen(string); @@ -162,7 +162,7 @@ char * SMSDMySQL_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char buff[0] = '\''; buff[1] = '\0'; - mysql_real_escape_string(conn->my, buff+1, string, len); + mysql_real_escape_string(Config->conn.my, buff+1, string, len); strcat(buff, "'"); return buff; } diff --git a/smsd/services/odbc.c b/smsd/services/odbc.c index db66b15..cd5030d 100644 --- a/smsd/services/odbc.c +++ b/smsd/services/odbc.c @@ -205,7 +205,7 @@ int SMSDODBC_NextRow(GSM_SMSDConfig * Config, SQL_result *res) } /* quote strings */ -char * SMSDODBC_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char *string) +char * SMSDODBC_QuoteString(GSM_SMSDConfig * Config, const char *string) { char *encoded_text = NULL; /* TODO: implement escaping */ diff --git a/smsd/services/pgsql.c b/smsd/services/pgsql.c index b214558..d285da2 100644 --- a/smsd/services/pgsql.c +++ b/smsd/services/pgsql.c @@ -143,7 +143,7 @@ static SQL_Error SMSDPgSQL_Query(GSM_SMSDConfig * Config, const char *query, SQL } /* Assume 2 * strlen(from) + 1 buffer in to */ -char * SMSDPgSQL_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char *from) +char * SMSDPgSQL_QuoteString(GSM_SMSDConfig * Config, const char *from) { char *to; int ret =0; @@ -151,7 +151,7 @@ char * SMSDPgSQL_QuoteString(GSM_SMSDConfig * Config, SQL_conn *conn, const char to[0] = '\''; to[1] = '\0'; #ifdef HAVE_PQESCAPESTRINGCONN - PQescapeStringConn(conn->pg, to+1, from, strlen(from), &ret); + PQescapeStringConn(Config->conn.pg, to+1, from, strlen(from), &ret); #else PQescapeString(to+1, from, strlen(from)); #endif diff --git a/smsd/services/sql-core.h b/smsd/services/sql-core.h index c38de28..8b6db08 100644 --- a/smsd/services/sql-core.h +++ b/smsd/services/sql-core.h @@ -146,7 +146,7 @@ struct GSM_SMSDdbobj { long long (* GetNumber)(GSM_SMSDConfig *, SQL_result, unsigned int); time_t (* GetDate)(GSM_SMSDConfig *, SQL_result, unsigned int); gboolean (* GetBool)(GSM_SMSDConfig *, SQL_result, unsigned int); - char * (* QuoteString)(GSM_SMSDConfig *, SQL_conn *conn, const char *); + char * (* QuoteString)(GSM_SMSDConfig *, const char *); }; /* database backends */ diff --git a/smsd/services/sql.c b/smsd/services/sql.c index f5f8571..4692076 100644 --- a/smsd/services/sql.c +++ b/smsd/services/sql.c @@ -204,7 +204,7 @@ static GSM_Error SMSDSQL_NamedQuery(GSM_SMSDConfig * Config, const char *sql_que ptr += sprintf(ptr, "%i", params[n].v.i); break; case SQL_TYPE_STRING: - buffer2 = db->QuoteString(Config, &Config->conn, params[n].v.s); + buffer2 = db->QuoteString(Config, params[n].v.s); memcpy(ptr, buffer2, strlen(buffer2)); ptr += strlen(buffer2); free(buffer2); @@ -328,7 +328,7 @@ static GSM_Error SMSDSQL_NamedQuery(GSM_SMSDConfig * Config, const char *sql_que if (numeric) { ptr += sprintf(ptr, "%i", int_to_print); } else if (to_print != NULL) { - buffer2 = db->QuoteString(Config, &Config->conn, to_print); + buffer2 = db->QuoteString(Config, to_print); memcpy(ptr, buffer2, strlen(buffer2)); ptr += strlen(buffer2); free(buffer2); -- Gammu _______________________________________________ Gammu-svn mailing list Gammu-svn@lists.cihar.com https://lists.cihar.com/cgi-bin/mailman/listinfo/gammu-svn