ECPG: Fix offset to NULL/size indicator array.
authorMichael Meskes <[email protected]>
Tue, 26 Nov 2013 16:16:39 +0000 (17:16 +0100)
committerMichael Meskes <[email protected]>
Tue, 26 Nov 2013 16:25:42 +0000 (17:25 +0100)
Patch by Boszormenyi Zoltan <[email protected]>

src/interfaces/ecpg/ecpglib/data.c

index 9ec78a599dcfbf42c1e16b6e577b4f4f03334b62..c27a2956a956b4390f401603b86089da1840a45e 100644 (file)
@@ -450,15 +450,15 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                {
                                    case ECPGt_short:
                                    case ECPGt_unsigned_short:
-                                       *((short *) (ind + offset * act_tuple)) = variable->len;
+                                       *((short *) (ind + ind_offset * act_tuple)) = variable->len;
                                        break;
                                    case ECPGt_int:
                                    case ECPGt_unsigned_int:
-                                       *((int *) (ind + offset * act_tuple)) = variable->len;
+                                       *((int *) (ind + ind_offset * act_tuple)) = variable->len;
                                        break;
                                    case ECPGt_long:
                                    case ECPGt_unsigned_long:
-                                       *((long *) (ind + offset * act_tuple)) = variable->len;
+                                       *((long *) (ind + ind_offset * act_tuple)) = variable->len;
                                        break;
 #ifdef HAVE_LONG_LONG_INT_64
                                    case ECPGt_long_long: