tweaks
This commit is contained in:
parent
cf4443b7fd
commit
6458157cda
@ -9,7 +9,7 @@ Preconditions:
|
|||||||
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const unsigned char zero[32];
|
static const unsigned char zero[32] = {0};
|
||||||
|
|
||||||
int fe_isnonzero(const fe f)
|
int fe_isnonzero(const fe f)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +409,7 @@ static void filters_add(const char *filter)
|
|||||||
memset(&f,0,sizeof(f));
|
memset(&f,0,sizeof(f));
|
||||||
f.re = re;
|
f.re = re;
|
||||||
size_t fl = strlen(filter) + 1;
|
size_t fl = strlen(filter) + 1;
|
||||||
f.str = malloc(fl);
|
f.str = (char *) malloc(fl);
|
||||||
if (!f.str)
|
if (!f.str)
|
||||||
abort();
|
abort();
|
||||||
memcpy(f.str,filter,fl);
|
memcpy(f.str,filter,fl);
|
||||||
|
6
main.c
6
main.c
@ -217,7 +217,7 @@ static void *dowork(void *task)
|
|||||||
memcpy(hashsrc,checksumstr,checksumstrlen);
|
memcpy(hashsrc,checksumstr,checksumstrlen);
|
||||||
hashsrc[checksumstrlen + PUBLIC_LEN] = 0x03; // version
|
hashsrc[checksumstrlen + PUBLIC_LEN] = 0x03; // version
|
||||||
|
|
||||||
sname = malloc(workdirlen + ONIONLEN + 63 + 1);
|
sname = (char *) malloc(workdirlen + ONIONLEN + 63 + 1);
|
||||||
if (!sname)
|
if (!sname)
|
||||||
abort();
|
abort();
|
||||||
if (workdir)
|
if (workdir)
|
||||||
@ -326,7 +326,7 @@ static void *dofastwork(void *task)
|
|||||||
memcpy(hashsrc,checksumstr,checksumstrlen);
|
memcpy(hashsrc,checksumstr,checksumstrlen);
|
||||||
hashsrc[checksumstrlen + PUBLIC_LEN] = 0x03; // version
|
hashsrc[checksumstrlen + PUBLIC_LEN] = 0x03; // version
|
||||||
|
|
||||||
sname = malloc(workdirlen + ONIONLEN + 63 + 1);
|
sname = (char *) malloc(workdirlen + ONIONLEN + 63 + 1);
|
||||||
if (!sname)
|
if (!sname)
|
||||||
abort();
|
abort();
|
||||||
if (workdir)
|
if (workdir)
|
||||||
@ -463,7 +463,7 @@ static void setworkdir(const char *wd)
|
|||||||
unsigned needslash = 0;
|
unsigned needslash = 0;
|
||||||
if (wd[l-1] != '/')
|
if (wd[l-1] != '/')
|
||||||
needslash = 1;
|
needslash = 1;
|
||||||
char *s = malloc(l + needslash + 1);
|
char *s = (char *) malloc(l + needslash + 1);
|
||||||
if (!s)
|
if (!s)
|
||||||
abort();
|
abort();
|
||||||
memcpy(s,wd,l);
|
memcpy(s,wd,l);
|
||||||
|
Loading…
Reference in New Issue
Block a user