mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Minor code simplification in util.c
darcs-hash:20070324193801-ac50b-e45d88fd7de0204467a0f7d52b71ee323f4e3f0d.gz
This commit is contained in:
parent
94a483d46b
commit
65d99117aa
1 changed files with 2 additions and 8 deletions
8
util.c
8
util.c
|
@ -1358,16 +1358,10 @@ int b_append( buffer_t *b, const void *d, ssize_t len )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( len < 0 )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( b->length <= (b->used + len) )
|
if( b->length <= (b->used + len) )
|
||||||
{
|
{
|
||||||
size_t l = maxi( b->length*2,
|
size_t l = maxi( b->length*2,
|
||||||
maxi( b->used+len+MIN_SIZE,MIN_SIZE));
|
b->used+len+MIN_SIZE );
|
||||||
|
|
||||||
void *d = realloc( b->buff, l );
|
void *d = realloc( b->buff, l );
|
||||||
if( !d )
|
if( !d )
|
||||||
|
|
Loading…
Reference in a new issue