mirror of
https://github.com/curl/curl.git
synced 2026-08-26 08:23:36 +03:00
rename indx var to idx, drop exception
This commit is contained in:
parent
a03b2a9246
commit
bf48b89954
2 changed files with 6 additions and 7 deletions
1
.github/scripts/codespell-ignore.txt
vendored
1
.github/scripts/codespell-ignore.txt
vendored
|
|
@ -12,7 +12,6 @@ dout
|
||||||
ede
|
ede
|
||||||
fo
|
fo
|
||||||
htpt
|
htpt
|
||||||
indx
|
|
||||||
inout
|
inout
|
||||||
nome
|
nome
|
||||||
numer
|
numer
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,14 @@ void curlx_dyn_free(struct dynbuf *s)
|
||||||
static CURLcode dyn_nappend(struct dynbuf *s,
|
static CURLcode dyn_nappend(struct dynbuf *s,
|
||||||
const unsigned char *mem, size_t len)
|
const unsigned char *mem, size_t len)
|
||||||
{
|
{
|
||||||
size_t indx = s->leng;
|
size_t idx = s->leng;
|
||||||
size_t a = s->allc;
|
size_t a = s->allc;
|
||||||
size_t fit = len + indx + 1; /* new string + old string + zero byte */
|
size_t fit = len + idx + 1; /* new string + old string + zero byte */
|
||||||
|
|
||||||
/* try to detect if there is rubbish in the struct */
|
/* try to detect if there is rubbish in the struct */
|
||||||
DEBUGASSERT(s->init == DYNINIT);
|
DEBUGASSERT(s->init == DYNINIT);
|
||||||
DEBUGASSERT(s->toobig);
|
DEBUGASSERT(s->toobig);
|
||||||
DEBUGASSERT(indx < s->toobig);
|
DEBUGASSERT(idx < s->toobig);
|
||||||
DEBUGASSERT(!s->leng || s->bufr);
|
DEBUGASSERT(!s->leng || s->bufr);
|
||||||
DEBUGASSERT(a <= s->toobig);
|
DEBUGASSERT(a <= s->toobig);
|
||||||
DEBUGASSERT(!len || mem);
|
DEBUGASSERT(!len || mem);
|
||||||
|
|
@ -88,7 +88,7 @@ static CURLcode dyn_nappend(struct dynbuf *s,
|
||||||
return CURLE_TOO_LARGE;
|
return CURLE_TOO_LARGE;
|
||||||
}
|
}
|
||||||
else if(!a) {
|
else if(!a) {
|
||||||
DEBUGASSERT(!indx);
|
DEBUGASSERT(!idx);
|
||||||
/* first invoke */
|
/* first invoke */
|
||||||
if(MIN_FIRST_ALLOC > s->toobig)
|
if(MIN_FIRST_ALLOC > s->toobig)
|
||||||
a = s->toobig;
|
a = s->toobig;
|
||||||
|
|
@ -118,8 +118,8 @@ static CURLcode dyn_nappend(struct dynbuf *s,
|
||||||
}
|
}
|
||||||
|
|
||||||
if(len)
|
if(len)
|
||||||
memcpy(&s->bufr[indx], mem, len);
|
memcpy(&s->bufr[idx], mem, len);
|
||||||
s->leng = indx + len;
|
s->leng = idx + len;
|
||||||
s->bufr[s->leng] = 0;
|
s->bufr[s->leng] = 0;
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue