diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-05-23 18:49:59 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-05-23 18:49:59 +0200 |
commit | 91140dcb42f441f8883b204fdfea367c133def9e (patch) | |
tree | e22aee085d61b4af4590e24bf5a8e58c6a7f3f49 /enginedata.cpp | |
parent | 059a8baa815f0b50d11546ad26b854572ef52182 (diff) |
Bugfixing
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<<'['; |