File meminit.diff of Package par2
Index: par2cmdline-0.4/reedsolomon.h
===================================================================
--- par2cmdline-0.4.orig/reedsolomon.h
+++ par2cmdline-0.4/reedsolomon.h
@@ -224,7 +224,9 @@ inline bool ReedSolomon<g>::Compute(Comm
// Allocate the left hand matrix
leftmatrix = new G[outcount * incount];
- memset(leftmatrix, 0, outcount * incount * sizeof(G));
+ //memset(leftmatrix, 0, outcount * incount * sizeof(G));
+ for (u32 _idx = 0; _idx < outcount*incount; ++_idx)
+ leftmatrix[_idx] = 0;
// Allocate the right hand matrix only if we are recovering
@@ -232,7 +234,9 @@ inline bool ReedSolomon<g>::Compute(Comm
if (datamissing > 0)
{
rightmatrix = new G[outcount * outcount];
- memset(rightmatrix, 0, outcount *outcount * sizeof(G));
+ //memset(rightmatrix, 0, outcount *outcount * sizeof(G));
+ for (u32 _idx = 0; _idx < outcount*outcount; ++_idx)
+ rightmatrix[_idx] = 0;
}
// Fill in the two matrices:
Index: par2cmdline-0.4/par2repairer.cpp
===================================================================
--- par2cmdline-0.4.orig/par2repairer.cpp
+++ par2cmdline-0.4/par2repairer.cpp
@@ -358,7 +358,7 @@ bool Par2Repairer::LoadPacketsFromFile(s
// Did we find the magic
if (current <= limit)
{
- memcpy(&header, current, sizeof(header));
+ memcpy((u8*)(&header), current, sizeof(header));
break;
}
}