aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-06 15:31:19 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2012-02-06 15:31:19 -0500
commitb9410fadc240758f511b314c7869022e539a49e9 (patch)
treeb5b92049833ad8af48042fd658542e84d78a4a1c
parent030988de935fbbf88bc5de0e3a01220867c8b064 (diff)
downloadmysqlerl-b9410fadc240758f511b314c7869022e539a49e9.tar.gz
mysqlerl-b9410fadc240758f511b314c7869022e539a49e9.zip
Fix warnings found by clang
-rw-r--r--src/mysqlerl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mysqlerl.c b/src/mysqlerl.c
index 146d5e3..020d9eb 100644
--- a/src/mysqlerl.c
+++ b/src/mysqlerl.c
@@ -223,8 +223,8 @@ handle_query(ETERM *cmd)
} else {
set_mysql_results();
if (results) {
- resp = handle_mysql_result(results);
- set_mysql_results(NULL);
+ resp = handle_mysql_result();
+ set_mysql_results();
} else {
if (mysql_field_count(&dbh) == 0)
resp = erl_format("{updated, ~i}", mysql_affected_rows(&dbh));
@@ -424,8 +424,8 @@ handle_param_query(ETERM *msg)
} else {
set_mysql_results();
if (results) {
- resp = handle_mysql_result(results);
- set_mysql_results(NULL);
+ resp = handle_mysql_result();
+ set_mysql_results();
} else {
if (mysql_field_count(&dbh) == 0)
resp = erl_format("{updated, ~i}", mysql_affected_rows(&dbh));
@@ -506,9 +506,8 @@ handle_select(ETERM *msg)
num_fields = mysql_num_fields(results);
fields = mysql_fetch_fields(results);
- resultoffset = pos - 1;
- if (resultoffset < 0)
- resultoffset = 0;
+ if (resultoffset > 0)
+ resultoffset = pos - 1;
if (num_items > numrows - resultoffset)
num_items = numrows - resultoffset;
mysql_data_seek(results, resultoffset);