diff options
author | James Every <devstopfix@gmail.com> | 2020-03-25 16:19:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 16:19:15 +0000 |
commit | 20c4068e5d8bd725c42513301b288094c8857041 (patch) | |
tree | bd226f972dfeaed7b11e76158ac1bd2243b89420 /src | |
parent | Merge commit '82cea2a0db4af442a3ea89a340e54fcd11cf8180' (diff) |
Convert to ports (#5)
* Remove erlexec dependency
* feat: async verify worker has started
* test: move infinite to script
* fix: timeout response
* fix: unix compile [Closes #169398412]
* feat: allow database patterns as worker param
This allows us to expand paths in an application, which is not possible from the configuration file.
* OTP 22 compatible with Elixir 1.7-1.10
* Install make on CI server
libmagic-dev contains magic.h
Fix this error:
** (Mix) Could not compile with "make" (exit status: 2).
* Fix make install
* Fix plurality
* Fix credo warning
* Allow multiple error messages
OS X and Linux return different errors messages.
* Allow named GenServer processes
* Types
* Disable test broken in ci
Works locally, not in CI.
test/gen_magic_test.exs:50
** (EXIT from #PID<0.1672.0>) shutdown
Diffstat (limited to 'src')
-rw-r--r-- | src/apprentice.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/apprentice.c b/src/apprentice.c index 04f08aa..1780f1e 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -98,7 +98,10 @@ void setup_options_file(char *optarg) { exit(1); } struct file *next = malloc(sizeof(struct file)); - next->path = strdup(optarg); + size_t path_length = strlen(optarg) + 1; + char *path = malloc(path_length); + memcpy(path, optarg, path_length); + next->path = path; next->next = magic_database; magic_database = next; } @@ -142,7 +145,7 @@ void process_line(char *line) { print_error("no_file"); return; } - + process_file(path); } |