aboutsummaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/inetd.c')
-rw-r--r--networking/inetd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 584c5e5e4..dce5a0885 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -645,7 +645,7 @@ static servtab_t *dup_servtab(servtab_t *sep)
645} 645}
646 646
647/* gcc generates much more code if this is inlined */ 647/* gcc generates much more code if this is inlined */
648static servtab_t *parse_one_line(void) 648static NOINLINE servtab_t *parse_one_line(void)
649{ 649{
650 int argc; 650 int argc;
651 char *token[6+MAXARGV]; 651 char *token[6+MAXARGV];
@@ -675,6 +675,8 @@ static servtab_t *parse_one_line(void)
675 * default host for the following lines. */ 675 * default host for the following lines. */
676 free(default_local_hostname); 676 free(default_local_hostname);
677 default_local_hostname = sep->se_local_hostname; 677 default_local_hostname = sep->se_local_hostname;
678 /*sep->se_local_hostname = NULL; - redundant */
679 /* (we'll overwrite this field anyway) */
678 goto more; 680 goto more;
679 } 681 }
680 } else 682 } else
@@ -688,10 +690,10 @@ static servtab_t *parse_one_line(void)
688 parse_err: 690 parse_err:
689 bb_error_msg("parse error on line %u, line is ignored", 691 bb_error_msg("parse error on line %u, line is ignored",
690 parser->lineno); 692 parser->lineno);
691 free_servtab_strings(sep);
692 /* Just "goto more" can make sep to carry over e.g. 693 /* Just "goto more" can make sep to carry over e.g.
693 * "rpc"-ness (by having se_rpcver_lo != 0). 694 * "rpc"-ness (by having se_rpcver_lo != 0).
694 * We will be more paranoid: */ 695 * We will be more paranoid: */
696 free_servtab_strings(sep);
695 free(sep); 697 free(sep);
696 goto new; 698 goto new;
697 } 699 }
@@ -725,7 +727,7 @@ static servtab_t *parse_one_line(void)
725 goto parse_err; 727 goto parse_err;
726#endif 728#endif
727 } 729 }
728 if (strncmp(arg, "rpc/", 4) == 0) { 730 if (is_prefixed_with(arg, "rpc/")) {
729#if ENABLE_FEATURE_INETD_RPC 731#if ENABLE_FEATURE_INETD_RPC
730 unsigned n; 732 unsigned n;
731 arg += 4; 733 arg += 4;
@@ -815,7 +817,7 @@ static servtab_t *parse_one_line(void)
815 } 817 }
816#endif 818#endif
817 argc = 0; 819 argc = 0;
818 while ((arg = token[6+argc]) != NULL && argc < MAXARGV) 820 while (argc < MAXARGV && (arg = token[6+argc]) != NULL)
819 sep->se_argv[argc++] = xstrdup(arg); 821 sep->se_argv[argc++] = xstrdup(arg);
820 /* Some inetd.conf files have no argv's, not even argv[0]. 822 /* Some inetd.conf files have no argv's, not even argv[0].
821 * Fix them up. 823 * Fix them up.
@@ -1654,7 +1656,7 @@ static void FAST_FUNC daytime_stream(int s, servtab_t *sep UNUSED_PARAM)
1654{ 1656{
1655 time_t t; 1657 time_t t;
1656 1658
1657 t = time(NULL); 1659 time(&t);
1658 fdprintf(s, "%.24s\r\n", ctime(&t)); 1660 fdprintf(s, "%.24s\r\n", ctime(&t));
1659} 1661}
1660static void FAST_FUNC daytime_dg(int s, servtab_t *sep) 1662static void FAST_FUNC daytime_dg(int s, servtab_t *sep)