argtable / argtable3

A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options.
http://www.argtable.org
Other
372 stars 65 forks source link

Fix the reset function in arg_str #41

Closed oopsmonk closed 4 years ago

oopsmonk commented 5 years ago

arg_parse calls arg_reset to reset data from previous args, but arg_str_resetfn does not clear the string so it causes a parsing issue. an example can be found in https://github.com/oopsmonk/iota_esp32_wallet/issues/9

tomghuang commented 4 years ago

@oopsmonk Thanks for your pull request. However, I believe parent->count = 0; should appear after the for loop. I'll merge the pull request first, and then fix the bug myself.

By the way, I'm glad to see that argtable3 is used on ESP32!

oopsmonk commented 4 years ago

@oopsmonk Thanks for your pull request. However, I believe parent->count = 0; should appear after the for loop. I'll merge the pull request first, and then fix the bug myself.

By the way, I'm glad to see that argtable3 is used on ESP32!

@tomghuang yes, don't know why I missed the parent->count = 0; in this PR, but not in my wallet project. Thanks :)