> your patch is way too complicated. You can simply check for > command[i].cmd == NULL to print the error. You're completely right. I don't know what I was thinking on. > > And of course you have to follow the coding style. I am not joking with > this one. It is the main reason for me to reject patches. I've replaced 3-space-tabs with real tabs. --- hcitool.c.orig 2007-12-28 20:06:58.000000000 +0100 +++ hcitool.c 2007-12-29 00:09:03.000000000 +0100 @@ -2329,5 +2329,11 @@ command[i].func(dev_id, argc, argv); break; } - return 0; + + if(!command[i].cmd) { + fprintf(stderr, "\"%s\" isn't a valid command. Try --help for a list of commands.\n", argv[0]); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); } ______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com