8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 490bbb5 commit 07d33caCopy full SHA for 07d33ca
ext/pg_result.c
@@ -861,16 +861,16 @@ pgresult_fields(VALUE self)
861
{
862
PGresult *result = pgresult_get( self );
863
int n = PQnfields( result );
864
- VALUE fields[ n ];
+ VALUE fields = rb_ary_new2( n );
865
int i;
866
867
for ( i = 0; i < n; i++ ) {
868
VALUE val = rb_tainted_str_new2(PQfname(result, i));
869
ASSOCIATE_INDEX(val, self);
870
- fields[ i ] = val;
+ rb_ary_store( fields, i, val );
871
}
872
873
- return rb_ary_new4( n, fields );
+ return fields;
874
875
876
0 commit comments