rename indx var to idx, drop exception

This commit is contained in:
Viktor Szakats 2025-07-12 09:52:35 +02:00
parent a03b2a9246
commit bf48b89954
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 6 additions and 7 deletions

View file

@ -12,7 +12,6 @@ dout
ede
fo
htpt
indx
inout
nome
numer

View file

@ -71,14 +71,14 @@ void curlx_dyn_free(struct dynbuf *s)
static CURLcode dyn_nappend(struct dynbuf *s,
const unsigned char *mem, size_t len)
{
size_t indx = s->leng;
size_t idx = s->leng;
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 */
DEBUGASSERT(s->init == DYNINIT);
DEBUGASSERT(s->toobig);
DEBUGASSERT(indx < s->toobig);
DEBUGASSERT(idx < s->toobig);
DEBUGASSERT(!s->leng || s->bufr);
DEBUGASSERT(a <= s->toobig);
DEBUGASSERT(!len || mem);
@ -88,7 +88,7 @@ static CURLcode dyn_nappend(struct dynbuf *s,
return CURLE_TOO_LARGE;
}
else if(!a) {
DEBUGASSERT(!indx);
DEBUGASSERT(!idx);
/* first invoke */
if(MIN_FIRST_ALLOC > s->toobig)
a = s->toobig;
@ -118,8 +118,8 @@ static CURLcode dyn_nappend(struct dynbuf *s,
}
if(len)
memcpy(&s->bufr[indx], mem, len);
s->leng = indx + len;
memcpy(&s->bufr[idx], mem, len);
s->leng = idx + len;
s->bufr[s->leng] = 0;
return CURLE_OK;
}