diff options
Diffstat (limited to 'enginedata.cpp')
-rw-r--r-- | enginedata.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/enginedata.cpp b/enginedata.cpp index fb60521..5cc357f 100644 --- a/enginedata.cpp +++ b/enginedata.cpp @@ -17,8 +17,14 @@ Row::Row(Row &&other):nc(other.nc),table(other.table),items(other.items){ //move other.items=nullptr; } Row::Row(const Row &other):nc(other.nc),table(other.table){ //copy constr - items=new RowItem[table->nc]; - memcpy(items,other.items,table->nc*sizeof(RowItem)); + items=new RowItem[nc]; + memcpy(items,other.items,nc*sizeof(RowItem)); + for(int i=0;i<nc;i++){ + if(table->header[i].type==RH_BYTES){ + items[i].rh_bytes=new unsigned char[table->header[i].arg]; + memcpy(items[i].rh_bytes,other.items[i].rh_bytes,table->header[i].arg); + } + } } ostream& operator<<(ostream &os,const Row &r){ os<<'['; |