Changes in trunk/src/sh_getopt.c [20:27]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_getopt.c
r20 r27 80 80 sh_util_set_interactive }, 81 81 #endif 82 #if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT) 83 { N_("server-port"), 84 '-', 85 N_("Set the server port to connect to"), 86 HAS_ARG_YES, 87 sh_forward_server_port }, 88 #endif 82 89 #ifdef SH_WITH_SERVER 83 90 { N_("server"), … … 112 119 HAS_ARG_YES, 113 120 sh_calls_set_bind_addr }, 114 #if def SH_WITH_CLIENT121 #if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT) 115 122 { N_("set-export-severity"), 116 123 'e', … … 391 398 if (op_table[i].hasArg == HAS_ARG_NO) { 392 399 if (sl_strlen(op_table[i].longopt) < 10) 393 s trcpy(fmt,_("%c%c%c --%-s,\t\t\t %s\n"));/* known to fit */400 sl_strlcpy(fmt,_("%c%c%c --%-s,\t\t\t %s\n"), sizeof(fmt)); 394 401 else if (sl_strlen(op_table[i].longopt) < 17) 395 s trcpy(fmt, _("%c%c%c --%-s,\t\t %s\n")); /* known to fit */402 sl_strlcpy(fmt, _("%c%c%c --%-s,\t\t %s\n"), sizeof(fmt)); 396 403 else 397 strcpy(fmt, _("%c%c%c --%-s,\t %s\n")); /* known to fit */ 398 /*@-formatconst@*/ 399 fprintf (stdout, 400 fmt, 404 sl_strlcpy(fmt, _("%c%c%c --%-s,\t %s\n"), sizeof(fmt)); 405 /* flawfinder: ignore */ 406 fprintf (stdout, fmt, 401 407 (op_table[i].shortopt == '-') ? ' ' : '-', 402 408 (op_table[i].shortopt == '-') ? ' ' : op_table[i].shortopt, … … 404 410 _(op_table[i].longopt), 405 411 _(op_table[i].usage)); 406 /*@+formatconst@*/407 412 } else { 408 413 if (sl_strlen(op_table[i].longopt) < 12) 409 strcpy(fmt, /* known to fit */ 410 _("%c%c %s --%-s=<arg>,\t\t %s\n")); 414 sl_strlcpy(fmt, _("%c%c %s --%-s=<arg>,\t\t %s\n"), sizeof(fmt)); 411 415 else 412 strcpy(fmt, /* known to fit */ 413 _("%c%c %s --%-s=<arg>,\t %s\n")); 414 /*@-formatconst@*/ 415 fprintf (stdout, 416 fmt, 416 sl_strlcpy(fmt, _("%c%c %s --%-s=<arg>,\t %s\n"), sizeof(fmt)); 417 /* flawfinder: ignore */ 418 fprintf (stdout, fmt, 417 419 (op_table[i].shortopt == '-') ? ' ' : '-', 418 420 (op_table[i].shortopt == '-') ? ' ' : op_table[i].shortopt, … … 420 422 _(op_table[i].longopt), 421 423 _(op_table[i].usage)); 422 /*@+formatconst@*/423 424 } 424 425 } … … 560 561 for (i = 0; op_table[i].longopt != NULL; ++i) 561 562 { 562 563 563 564 if (sl_strncmp(_(op_table[i].longopt), 564 565 &argv[1][2], … … 568 569 if ( op_table[i].hasArg == HAS_ARG_YES ) 569 570 { 570 if ( (theequal = strchr(argv[1], '=')) == NULL) 571 theequal = strchr(argv[1], '='); 572 if (theequal == NULL) 571 573 { 572 574 if (argc < 3)
Note:
See TracChangeset
for help on using the changeset viewer.