summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fstring.h19
-rw-r--r--src/hash.h2
2 files changed, 15 insertions, 6 deletions
diff --git a/src/fstring.h b/src/fstring.h
index d0307b5..7dda87c 100644
--- a/src/fstring.h
+++ b/src/fstring.h
@@ -138,6 +138,11 @@ namespace Bu
138 append( &cData, 1 ); 138 append( &cData, 1 );
139 } 139 }
140 140
141 void prepend( const MyType & sData )
142 {
143 prepend( sData.getStr(), sData.getSize() );
144 }
145
141 void prepend( const chr *pData ) 146 void prepend( const chr *pData )
142 { 147 {
143 long nLen; 148 long nLen;
@@ -413,17 +418,21 @@ namespace Bu
413 clear(); 418 clear();
414 long nLen; 419 long nLen;
415 ar >> nLen; 420 ar >> nLen;
416 421
417 Chunk *pNew = newChunk( nLen ); 422 if( nLen > 0 )
418 ar.read( pNew->pData, nLen*sizeof(chr) ); 423 {
419 appendChunk( pNew ); 424 Chunk *pNew = newChunk( nLen );
425 ar.read( pNew->pData, nLen*sizeof(chr) );
426 appendChunk( pNew );
427 }
420 } 428 }
421 else 429 else
422 { 430 {
423 flatten(); 431 flatten();
424 432
425 ar << nLength; 433 ar << nLength;
426 ar.write( pFirst->pData, nLength*sizeof(chr) ); 434 if( nLength )
435 ar.write( pFirst->pData, nLength*sizeof(chr) );
427 } 436 }
428 } 437 }
429 438
diff --git a/src/hash.h b/src/hash.h
index f6c207f..1bb25c9 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -458,7 +458,7 @@ namespace Bu
458 458
459 value &operator *() 459 value &operator *()
460 { 460 {
461 return hsh.getAtPos( nPos ); 461 return hsh.getValueAtPos( nPos );
462 } 462 }
463 463
464 key &getKey() 464 key &getKey()