On Nov 11, 2014 4:13 PM, "Rory McNamara" <[email protected]> wrote: > > Well that was stupid. Revision attached. > I appreciate all the help you've given me.
There's an extra strlen(name) within the if statement of the first loop. Since you have a variable now for strlen(name), you can replace the second call to strlen(name) with just len. Sorry, couldn't help myself. :) Sean P. S. Nice last name... > > Rory > > On 11 November 2014 21:07, Ben Boeckel <[email protected]> wrote: > > On Tue, Nov 11, 2014 at 20:34:08 +0000, Rory McNamara wrote: > >> Would have thought the compiler would do that for me, but I've cached it anyway. > > > > Not all compilers are that smart :( . > > > >> Good point on the second, missed that when I changed the loops. > >> Fixed attached. > > > > One last nit :) . > > > > --Ben > > > >> - if (strcmp(name, mpc_table[i].command) == 0) > >> + if (strncmp(name, mpc_table[i].command, len) == 0 && strncmp(name, mpc_table[i].command, len) == 0) > > > > This is now "if (a && a)" > > _______________________________________________ > mpd-devel mailing list > [email protected] > http://mailman.blarg.de/listinfo/mpd-devel >
_______________________________________________ mpd-devel mailing list [email protected] http://mailman.blarg.de/listinfo/mpd-devel
