X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=libcitadel%2Flib%2Fstringbuf.c;h=9804e5e4b6968f3feb7366d5cbb3d36dc3db4bbc;hp=8a1528bbee2c6eb46815d0eef6040bc71e3f2392;hb=6b5f7c9bbe2f754fb0f2ff433b90dd76e76836eb;hpb=500dbfd92ee52df131d21061ea70ec58c8e256c6 diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 8a1528bbe..9804e5e4b 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -2622,15 +2622,12 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp, StrBuf *EncBuf) { StrBuf *Target; - int need_to_encode; - const char *pch, *pche; const char *UserStart, *UserEnd, *EmailStart, *EmailEnd, *At; if ((Recp == NULL) || (StrLength(Recp) == 0)) return NULL; - need_to_encode = 0; pch = ChrPtr(Recp); pche = pch + StrLength(Recp); @@ -2641,8 +2638,6 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp, while ((pch != NULL) && (pch < pche)) { - int ColonOk = 0; - while (isspace(*pch)) pch++; UserStart = UserEnd = EmailStart = EmailEnd = NULL; @@ -2672,7 +2667,6 @@ StrBuf *StrBufSanitizeEmailRecipientVector(const StrBuf *Recp, if (EmailEnd == NULL) EmailEnd = pche; pch = EmailEnd + 1; - ColonOk = 1; } else { int gt = 0; @@ -3991,7 +3985,7 @@ static const char *ErrRBLF_BLOBPreConditionFailed="StrBufReadBLOB: Wrong argumen int StrBufReadBLOB(StrBuf *Buf, int *fd, int append, long nBytes, const char **Error) { int fdflags; - int len, rlen, slen; + int rlen; int nSuccessLess; int nRead = 0; char *ptr; @@ -4011,8 +4005,6 @@ int StrBufReadBLOB(StrBuf *Buf, int *fd, int append, long nBytes, const char **E ptr = Buf->buf + Buf->BufUsed; - slen = len = Buf->BufUsed; - fdflags = fcntl(*fd, F_GETFL); IsNonBlock = (fdflags & O_NONBLOCK) == O_NONBLOCK; nSuccessLess = 0; @@ -4081,17 +4073,15 @@ int StrBufReadBLOBBuffered(StrBuf *Blob, int check, const char **Error) { - const char *pche; const char *pos; int fdflags; int len = 0; - int rlen, slen; + int rlen; int nRead = 0; int nAlreadyRead = 0; int IsNonBlock; char *ptr; fd_set rfds; - const char *pch; struct timeval tv; int nSuccessLess = 0; int MaxTries; @@ -4120,9 +4110,6 @@ int StrBufReadBLOBBuffered(StrBuf *Blob, (pos != NULL) && (pos < IOBuf->buf + IOBuf->BufUsed)) { - pche = IOBuf->buf + IOBuf->BufUsed; - pch = pos; - if (rlen < nBytes) { memcpy(Blob->buf + Blob->BufUsed, pos, rlen); Blob->BufUsed += rlen; @@ -4150,7 +4137,7 @@ int StrBufReadBLOBBuffered(StrBuf *Blob, IncreaseBuf(IOBuf, 0, nBytes - nRead); ptr = IOBuf->buf; - slen = len = Blob->BufUsed; + len = Blob->BufUsed; fdflags = fcntl(*fd, F_GETFL); IsNonBlock = (fdflags & O_NONBLOCK) == O_NONBLOCK; @@ -4243,7 +4230,7 @@ int StrBufReadBLOBBuffered(StrBuf *Blob, * has to be &NULL on start; will be &NotNULL on end of buffer * @returns size of remaining buffer */ -int StrBufSipLine(StrBuf *LineBuf, StrBuf *Buf, const char **Ptr) +int StrBufSipLine(StrBuf *LineBuf, const StrBuf *Buf, const char **Ptr) { const char *aptr, *ptr, *eptr; char *optr, *xptr;