} else if (strcmp ("PAYLOAD", var) == 0) {
if ((*val == '"') && (val[strlen (val) - 1] == '"')) {
val++;
- rc = strlen (val) - 1;
+ rc = strlen (val);
uint8_t *buf = *payload = (uint8_t *) calloc (rc, 1);
do {
*buf++ = *val++;
fclose (fid);
} else if (strlen (val) % 2 == 0) {
rc = strlen (val) / 2;
- uint8_t *buf = *payload = (uint8_t *) calloc (rc / 2, 1);
+ uint8_t *buf = *payload = (uint8_t *) calloc (rc, 1);
while (*val != '\0') {
char digit[3] = {0};
digit[0] = *val++;
break;
}
}
+ free (str);
return rc;
}
}
/* test: morep_valid.exe -h | grep usage */
+/* test: morep_valid.exe -r 2>&1 | grep 'url not specified' */
+/* test: morep_valid.exe -t 2>&1 | grep 'url not specified' */
+/* test: morep_valid.exe -t lo://00:00:00:00:00:00/0808 -v 4 script-lo.eth */
+/* test: morep_valid.exe -t lo://00:00:00:00:00:00/0808 -r lo://00:00:00:00:00:00/0808 script-lo.eth */
/* vim: set ts=4 sw=4 si et: */