pcmcia-check-broken-cis broken?

Boris Bliznioukov blib at dsi.ru
Sat Dec 24 06:03:36 EST 2005


Hello,

I'm looking at this pice of code in main(pcmcia-check-broken-cis.c)  
and wondering is it working?


         while (entry) {
                 if (!entry->cisfile)
                         return 0;

		// read the tuple

                 if (strncmp((char *) tuple.TupleData, entry->info,
                             strlen(entry->info)) != 0) {
                         entry++;
                         continue;
                 }

                 if (repair) {
                         return repair_cis(entry->cisfile, socket_no);
                 } else {
                         printf("%s", entry->cisfile);
                 }
         };

if you have match and repair == 0 you have endless loop since entry  
pointer is never advanced.
It should have return or break next to the printf.
Is it right? Or it is too early in the morning...

Boris./



More information about the linux-pcmcia mailing list