From b9410fadc240758f511b314c7869022e539a49e9 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 6 Feb 2012 15:31:19 -0500 Subject: Fix warnings found by clang --- src/mysqlerl.c | 13 ++++++------- 1 file 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); -- cgit v1.2.3