Commit 039f680f authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Make size computation branch-free and improve clarity.

parent dd96c575
......@@ -687,7 +687,8 @@ int grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1)
fileSetPos(fileID1, recpos, SEEK_SET);
gribbuffersize = recsize == (recsize>>3)<<3 ? recsize : (1+(recsize>>3))<<3;
/* round up recsize to next multiple of 8 */
gribbuffersize = (size_t)((recsize + 7) & ~7);
gribbuffer = (unsigned char *) malloc(gribbuffersize);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment