Explorar o código

[FIX] Usability bug fix in server_ctt

 - At present the check "help" in argv to call the
   usage() function is not handled as expected
 - In either case the the code goes into the if
   condition and returns EXIT_SUCCESS
 - Fix the minor issue so that code returns this status
   if it identifies --help or -h

Change-Id: I56876ac562647076a5b33259b2ea398b3bc5e584
Signed-off-by: Asish Ganesh <asish.g@kalycito.com>
Asish Ganesh %!s(int64=4) %!d(string=hai) anos
pai
achega
2ef4bfd34b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/server_ctt.c

+ 1 - 1
examples/server_ctt.c

@@ -456,7 +456,7 @@ int main(int argc, char **argv) {
     signal(SIGTERM, stopHandler);
     signal(SIGTERM, stopHandler);
 
 
     for(int i = 1; i < argc; i++) {
     for(int i = 1; i < argc; i++) {
-        if(strcmp(argv[i], "--help") ||
+        if(strcmp(argv[i], "--help") == 0 ||
            strcmp(argv[i], "-h") == 0) {
            strcmp(argv[i], "-h") == 0) {
             usage();
             usage();
             return EXIT_SUCCESS;
             return EXIT_SUCCESS;