Replace '#' by '\0' in commands read from batch files in order to avoid
processing the remaining part of the line, thus allowing users to use
comments in the files.
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
        char buf[65536];
        int n_argc;
        FILE *fp;
+       char *cp;
        int err;
        int i;
 
        if (json_output)
                jsonw_start_array(json_wtr);
        while (fgets(buf, sizeof(buf), fp)) {
+               cp = strchr(buf, '#');
+               if (cp)
+                       *cp = '\0';
+
                if (strlen(buf) == sizeof(buf) - 1) {
                        errno = E2BIG;
                        break;