if(NULL == outcurl)
return NULL; /* failure */
- do {
+ for(;;) {
/*
* We setup a few buffers we need. We should probably make them
outcurl->magic = CURLEASY_MAGIC_NUMBER;
fail = FALSE; /* we reach this point and thus we are OK */
+ break;
- } while(0);
+ }
if(fail) {
if(outcurl) {
Curl_FormInit(&formread, form);
- do {
+ for(;;) {
nread = Curl_FormReader(buffer, 1, sizeof(buffer),
(FILE *)&formread);
if(nread < 1)
break;
fwrite(buffer, nread, 1, stdout);
- } while(1);
+ }
fprintf(stdout, "size: ");
fprintf(stdout, "%" FORMAT_OFF_T, size);
int rc;
int what;
- while(1) {
+ for(;;) {
/* check allowed time left */
timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
/* Create HMAC context. */
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
- ctxt = (HMAC_context *) malloc(i);
+ ctxt = malloc(i);
if(!ctxt)
return ctxt;
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
for (i = 0; i < keylen; i++) {
- b = *key ^ hmac_ipad;
+ b = (unsigned char)(*key ^ hmac_ipad);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
- b = *key++ ^ hmac_opad;
+ b = (unsigned char)(*key++ ^ hmac_opad);
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
}
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
/* Wait for the name resolve query to complete. */
- while(1) {
+ for(;;) {
struct timeval *tvp, tv, store;
long timediff;
int itimeout;
/* clear off any former leftovers and init to defaults */
Curl_digest_cleanup_one(d);
- while(1) {
+ for(;;) {
char value[MAX_VALUE_LENGTH];
char content[MAX_CONTENT_LENGTH];
ssl_set_dbg(&conn->ssl[sockindex].ssl, polarssl_debug, data);
#endif
- do {
+ for(;;) {
if (!(ret = ssl_handshake(&conn->ssl[sockindex].ssl))) {
break;
} else if(ret != POLARSSL_ERR_NET_TRY_AGAIN) {
break;
}
}
- } while (1);
+ }
infof(data, "PolarSSL: Handshake complete, cipher is %s\n",
ssl_get_cipher(&conn->ssl[sockindex].ssl));
static int hostmatch(const char *hostname, const char *pattern)
{
- while(1) {
+ for(;;) {
char c = *pattern++;
if(c == '\0')