Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit efd019f

Browse files
author
Michael Meskes
committed
Fixed copy&paste mistake that made library use uninitialized variable.
1 parent b5d23f2 commit efd019f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.80 2009/02/02 16:14:06 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.81 2009/02/03 08:48:29 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -391,7 +391,11 @@ ecpg_store_result(const PGresult *results, int act_field,
391391
}
392392
}
393393
else
394-
len = PQgetlength(results, act_tuple, act_field);
394+
{
395+
for (act_tuple = 0; act_tuple < ntuples; act_tuple++)
396+
len += strlen(PQgetvalue(results, act_tuple, act_field)) + 1;
397+
}
398+
395399
ecpg_log("ecpg_store_result on line %d: allocating memory for %d tuples\n", stmt->lineno, ntuples);
396400
var->value = (char *) ecpg_alloc(len, stmt->lineno);
397401
if (!var->value)

0 commit comments

Comments
 (0)