cmdline (merge-intel): fix compilation with icc
[libcmdline.git] / src / lib / cmdline_parse.c
index d5f5988..334b3e3 100644 (file)
@@ -153,9 +153,16 @@ match_inst(cmdline_parse_inst_t *inst, const char *buf, unsigned int nb_match_to
                if ( isendofline(*buf) || iscomment(*buf) )
                        break;
 
-               n = token_hdr.ops->parse(token_p, buf, (result_buf ? result_buf+token_hdr.offset : NULL));
-               if ( n < 0 )
+               if (result_buf)
+                       n = token_hdr.ops->parse(token_p, buf,
+                                                (char *)result_buf +
+                                                token_hdr.offset);
+               else
+                       n = token_hdr.ops->parse(token_p, buf, NULL);
+
+               if (n < 0)
                        break;
+
                debug_printf("TK parsed (len=%d)\n", n);
                i++;
                buf += n;