Skip to content

Commit c4a9c5f

Browse files
committed
Completely rewrote the code
Moved unnecessary defines and functions to the source file, changed the `arg_parse` declaration to make it re-entrant.
1 parent 7639c65 commit c4a9c5f

File tree

3 files changed

+217
-258
lines changed

3 files changed

+217
-258
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ int main (int argc, char ** argv) {
4545
arg_return code;
4646
/* in case of an error, this is going to point to the program's argument
4747
* that was the cause of it */
48-
char ** ptr;
48+
char * ptr;
4949

5050
/* buffer for the elements, that are not keys */
5151
char * nk_buffer = NULL;
5252
/* size of the nk_buffer */
5353
size_t buf_size;
5454

5555
/* parse the program's arguments */
56-
if ((ptr = arg_parse (argc, argv, list, &nk_buffer, &buf_size, &code)) != NULL) {
57-
printf ("An error occured here: %s", *ptr);
56+
if ((ptr = arg_parse (&argc, &argv, list, &nk_buffer, &buf_size, &code)) != NULL) {
57+
printf ("An error occured here: %s", ptr);
5858
return code;
5959
}
6060

0 commit comments

Comments
 (0)