On Fri, Jun 24, 2011 at 06:51:51PM +0200, Alon Levy wrote: > On Fri, Jun 24, 2011 at 04:37:39PM +0200, Christophe Fergeau wrote: > > The previous parser had copy and paste errors when computing > > vname_length and type_params_length, "name" was used instead > > of respectively vname and type_params. This led to length that could > > be bigger than the input string, and to access out of the array > > bounds when trying to copy these strings. valgrind rightfully > > complained about this. It also didn't handle empty fields correctly, > > and there were some args = strip(args++); which also didn't do what > > was expected. > > Aren't there token parsing functions in libc that can be used if we > want to fix the repetitiveness?
The only token parsing function I know of in libc is strtok{_r} which modifies the input string, so it's not very well suited here. I'm not a libc specialist though, so there might be some functions in libc (or qemu helpers) that I don't know of. Christophe
pgpZkrVNT3zIm.pgp
Description: PGP signature