fix internal testnet bootstrap

remove release tag
This commit is contained in:
Rick V 2019-03-20 19:45:43 -05:00
parent e7fe345b7c
commit de1714c399
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465
3 changed files with 17 additions and 4 deletions

View File

@ -2202,6 +2202,19 @@ bool initTLS()
return true; return true;
} }
void *memncat(a, an, b, bn, s)
const void *a;
size_t an;
const void *b;
size_t bn;
size_t s;
{
char *p = malloc(s * (an + bn));
memset(p, '\0', s * (an + bn));
memcpy(p, a, an*s);
memcpy(p + an*s, b, bn*s);
return p;
}
main(argc, argv) main(argc, argv)
char** argv; char** argv;
@ -2292,7 +2305,7 @@ char** argv;
break; break;
} }
else { else {
strncat(rq, buf, r); rq = memncat(rq, len, buf, r, sizeof(char));
len += r; len += r;
} }
} while (r != 0); } while (r != 0);
@ -2307,10 +2320,11 @@ char** argv;
snprintf(path, MAX_PATH, "%s\\.lokinet\\bootstrap.signed", getenv("APPDATA")); snprintf(path, MAX_PATH, "%s\\.lokinet\\bootstrap.signed", getenv("APPDATA"));
resp = strstr(rq, "Content-Length"); resp = strstr(rq, "Content-Length");
r = strcspn(resp, "0123456789"); r = strcspn(resp, "0123456789");
snprintf(buf, 4, "%s", &resp[r]); memcpy(buf, &resp[r], 4);
buf[3] = '\0';
r = atoi(buf); r = atoi(buf);
resp = strstr(rq, "\r\n\r\n"); resp = strstr(rq, "\r\n\r\n");
snprintf(buf, r, "%s", &resp[4]); memcpy(buf, &resp[4], r);
printf("Writing %s...\n", path); printf("Writing %s...\n", path);
bootstrapRC = fopen(path, "wb"); bootstrapRC = fopen(path, "wb");
fwrite(buf, 1, r, bootstrapRC); fwrite(buf, 1, r, bootstrapRC);

Binary file not shown.

View File

@ -12,7 +12,6 @@
#endif #endif
#include <idp.iss> #include <idp.iss>
#include "version.txt" #include "version.txt"
#define RELEASE
; see ../LICENSE ; see ../LICENSE