Commit 3878455 1 parent fdcec53 commit 3878455 Copy full SHA for 3878455
File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -584,11 +584,10 @@ static uint64_t rand64(void)
584
584
static struct buf * alloc_buf (jmp_buf * env )
585
585
{
586
586
struct buf * buf = (struct buf * )mem_alloc (sizeof (struct buf ));
587
- size_t len = BUFFER_SIZE ;
588
- char * data = (char * )mem_alloc (len );
587
+ char * data = (char * )mem_alloc (BUFFER_SIZE );
589
588
buf -> env = env ;
590
589
buf -> data = data ;
591
- buf -> len = len ;
590
+ buf -> len = BUFFER_SIZE ;
592
591
buf -> ptr = 0 ;
593
592
buf -> ref_count = 1 ;
594
593
return buf ;
@@ -600,9 +599,9 @@ static void reset_buf(struct buf *buf)
600
599
if (buf -> len > BUFFER_SIZE )
601
600
{
602
601
mem_free (buf -> data );
603
- buf -> len = BUFFER_SIZE ;
604
- buf -> data = (char * )mem_alloc (buf -> len );
602
+ buf -> data = (char * )mem_alloc (BUFFER_SIZE );
605
603
}
604
+ buf -> len = BUFFER_SIZE ;
606
605
buf -> ptr = 0 ;
607
606
}
608
607
You can’t perform that action at this time.
0 commit comments