diff --git a/MD5.c b/MD5.c index 7ae26305b81d426db70cbcf4d1cbc42ab2122f04..fb18a5bba4df59126a4844025b07b06b751a7e4d 100644 --- a/MD5.c +++ b/MD5.c @@ -417,14 +417,16 @@ static void md5_finish(md5_state_t* pms, md5_byte_t digest[16]) int i; /* Save the length before padding. */ - for (i = 0; i < 8; ++i) + for (i = 0; i < 8; ++i) { data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); + } /* Pad to 56 bytes mod 64. */ md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); /* Append the length. */ md5_append(pms, data, 8); - for (i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) { digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); + } } #if defined(__clang__) && !defined(__INTEL_COMPILER) diff --git a/ProcessUNIX.c b/ProcessUNIX.c index d3a09eded340e8eda7fb6b16e2d645bb4793d95a..a700ed3fc4945529b8117ce786151841456832ca 100644 --- a/ProcessUNIX.c +++ b/ProcessUNIX.c @@ -1147,8 +1147,8 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, read until the operation is not interrupted. */ while (((n = read(cp->PipeReadEnds[i], cp->PipeBuffer, KWSYSPE_PIPE_BUFFER_SIZE)) < 0) && - (errno == EINTR)) - ; + (errno == EINTR)) { + } if (n > 0) { /* We have data on this pipe. */ if (i == KWSYSPE_PIPE_SIGNAL) { @@ -1221,8 +1221,8 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, /* Run select to block until data are available. Repeat call until it is not interrupted. */ while (((numReady = select(max + 1, &cp->PipeSet, 0, 0, timeout)) < 0) && - (errno == EINTR)) - ; + (errno == EINTR)) { + } /* Check result of select. */ if (numReady == 0) { @@ -1892,8 +1892,8 @@ static void kwsysProcessDestroy(kwsysProcess* cp) int result; while (((result = waitpid(cp->ForkPIDs[i], &cp->CommandExitCodes[i], WNOHANG)) < 0) && - (errno == EINTR)) - ; + (errno == EINTR)) { + } if (result > 0) { /* This child has termianted. */ cp->ForkPIDs[i] = 0;