On Saturday 02 February 2013 17:47:40 David Sommerseth wrote: > Wouldn't this approach solve it in an easier way? > > int offset = 0; > if (line_num == 1 && strncmp (line, "\xEF\xBB\xBF", 3) == 0) > offset = 3 > > if (parse_line (line+offset, p, SIZE (p), file, line_num .... > > Should be safer as you don't need care about proper NULL termination of > the buffer.
Although fgets(3) is supposed to always \0 terminate the buffer I like your approach better, as it's more lightweight. Will send an updated version. Heiko