itox.c (xinetd-2.3.15) | : | itox.c (xinetd-2.3.15.4.tar.xz) | ||
---|---|---|---|---|
/* | /* | |||
* (c) Copyright 1992 by Panagiotis Tsirigotis | * (c) Copyright 1992 by Panagiotis Tsirigotis | |||
* (c) Sections Copyright 1998-2001 by Rob Braun | * (c) Sections Copyright 1998-2001 by Rob Braun | |||
* All rights reserved. The file named COPYRIGHT specifies the terms | * All rights reserved. The file named COPYRIGHT specifies the terms | |||
* and conditions for redistribution. | * and conditions for redistribution. | |||
*/ | */ | |||
static char RCSid[] = "$Id: itox.c,v 1.4 2007-09-20 17:13:24 bbraun Exp $" ; | ||||
#include "config.h" | #include "config.h" | |||
#define EQ( s1, s2 ) ( strcmp( s1, s2 ) == 0 ) | #define EQ( s1, s2 ) ( strcmp( s1, s2 ) == 0 ) | |||
#define NUL '\0' | #define NUL '\0' | |||
#define static static | #define static static | |||
#define FIELD_WIDTH 15 | #define FIELD_WIDTH 15 | |||
#define DAEMON_DIR_OPTION "-daemon_dir" | #define DAEMON_DIR_OPTION "-daemon_dir" | |||
#define TCPD_NAME "tcpd" | #define TCPD_NAME "tcpd" | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <string.h> | #include <string.h> | |||
#include "sio.h" | #include "sio.h" | |||
#include "str.h" | #include "str.h" | |||
#if !defined(linux) | ||||
#include "misc.h" | ||||
#else | ||||
#include <libgen.h> | #include <libgen.h> | |||
#endif | ||||
str_h strp ; | str_h strp ; | |||
int line_count ; | int line_count ; | |||
static void print_line( const char *name, const char *value ); | static void print_line( const char *name, const char *value ); | |||
static char *next_word( const char *description ); | static char *next_word( const char *description ); | |||
static char *make_string_cat( register unsigned count, ... ); | static char *make_string_cat( register unsigned count, ... ); | |||
static char *make_pathname( register unsigned count, ... ); | static char *make_pathname( register unsigned count, ... ); | |||
/* | /* | |||
* This program works only as a filter. | * This program works only as a filter. | |||
skipping to change at line 219 | skipping to change at line 213 | |||
char *word = str_component( strp ) ; | char *word = str_component( strp ) ; | |||
if ( word == NULL ) | if ( word == NULL ) | |||
{ | { | |||
Sprint( 2, "Line %d: %s missing \n", line_count, description ) ; | Sprint( 2, "Line %d: %s missing \n", line_count, description ) ; | |||
exit( 1 ) ; | exit( 1 ) ; | |||
} | } | |||
return( word ) ; | return( word ) ; | |||
} | } | |||
static char *make_string_cat( register unsigned count, ... ) | static char *make_string_cat( const unsigned count, ... ) | |||
{ | { | |||
va_list ap ; | va_list ap ; | |||
register unsigned i ; | register unsigned i ; | |||
register unsigned len = 0 ; | register unsigned len = 0 ; | |||
register char *s, *p ; | register char *s, *p ; | |||
char *newstring ; | char *newstring ; | |||
if ( count == 0 ) | if ( count == 0 ) | |||
return( NULL ) ; | return( NULL ) ; | |||
skipping to change at line 268 | skipping to change at line 262 | |||
if ( s == NULL ) | if ( s == NULL ) | |||
continue ; | continue ; | |||
while ( (*p++ = *s++) ) ; | while ( (*p++ = *s++) ) ; | |||
p-- ; | p-- ; | |||
} | } | |||
va_end( ap ) ; | va_end( ap ) ; | |||
newstring[len] = 0; /* if len == 0, must terminate or boom! */ | newstring[len] = 0; /* if len == 0, must terminate or boom! */ | |||
return newstring ; | return newstring ; | |||
} | } | |||
static char *make_pathname( register unsigned count, ... ) | static char *make_pathname( const unsigned count, ... ) | |||
{ | { | |||
va_list ap ; | va_list ap ; | |||
register unsigned i ; | register unsigned i ; | |||
register unsigned len = 0 ; | register unsigned len = 0 ; | |||
register char *s, *p ; | register char *s, *p ; | |||
char *pathname ; | char *pathname ; | |||
if ( count == 0 ) | if ( count == 0 ) | |||
return( NULL ) ; | return( NULL ) ; | |||
End of changes. 5 change blocks. | ||||
8 lines changed or deleted | 2 lines changed or added |