From d86216b6176ce1587584cb988bf73e6825ad3bb8 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sat, 1 Mar 2008 23:56:19 -0500 Subject: Fix i/j tyop. --- src/mysqlerl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mysqlerl.c b/src/mysqlerl.c index d4b9065..b1729f6 100644 --- a/src/mysqlerl.c +++ b/src/mysqlerl.c @@ -214,9 +214,14 @@ handle_sql_query(MYSQL *dbh, ETERM *cmd) rowtup = (ETERM **)malloc(num_fields * sizeof(ETERM *)); for (j = 0; j < num_fields; j++) { logmsg("DEBUG: rows[%d][%d]: %s", i, j, row[j]); - rowtup[i] = erl_format("~s", row[j]); + rowtup[j] = erl_format("~s", row[j]); } + logmsg("DEBUG: making tuple of %d", num_fields); rt = erl_mk_tuple(rowtup, num_fields); + if (rt == NULL) { + logmsg("ERROR: couldn't allocate %d-tuple", num_fields); + exit(3); + } rows[i] = erl_format("~w", rt); for (j = 0; j < num_fields; j++) -- cgit v1.2.3