isdnrep and lib: bugfixes
This commit is contained in:
parent
bfa9edbaf3
commit
44796a035d
|
@ -24,6 +24,22 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.46 1998/10/04 12:04:21 akool
|
||||||
|
* - README
|
||||||
|
* New entries "CALLFILE" and "CALLFMT" documented
|
||||||
|
* Small Correction from Markus Werner <mw@empire.wolfsburg.de>
|
||||||
|
* cosmetics
|
||||||
|
*
|
||||||
|
* - isdnrep.c
|
||||||
|
* Bugfix (Thanks to Arnd Bergmann <arnd@uni.de>)
|
||||||
|
*
|
||||||
|
* - processor.c
|
||||||
|
* Patch from Oliver Lauer <Oliver.Lauer@coburg.baynet.de>
|
||||||
|
* Makes CHARGEMAX work without AOC-D
|
||||||
|
*
|
||||||
|
* Patch from Stefan Gruendel <sgruendel@adulo.de>
|
||||||
|
* gcc 2.7.2.1 Optimizer-Bug workaround
|
||||||
|
*
|
||||||
* Revision 1.45 1998/10/03 18:06:35 akool
|
* Revision 1.45 1998/10/03 18:06:35 akool
|
||||||
* - processor.c, takt_at.c : Patch from Michael Reinelt <reinelt@eunet.at>
|
* - processor.c, takt_at.c : Patch from Michael Reinelt <reinelt@eunet.at>
|
||||||
* try to guess the zone of the calling/called party
|
* try to guess the zone of the calling/called party
|
||||||
|
@ -1134,9 +1150,10 @@ static int print_bottom(double unit, char *start, char *stop)
|
||||||
else
|
else
|
||||||
if ((p = get_areacode(unknown[i].num, &l, flag)) != 0) {
|
if ((p = get_areacode(unknown[i].num, &l, flag)) != 0) {
|
||||||
if (l > 1) {
|
if (l > 1) {
|
||||||
strncpy(areacode, unknown[i].num, 2 + prefix);
|
/* Sehr gefaehrlich, was ist mit Laendern, die einen dreistelligen Code haben??? */
|
||||||
|
Strncpy(areacode, unknown[i].num, 3 + prefix);
|
||||||
if ((l - (2 + prefix)) > 0) {
|
if ((l - (2 + prefix)) > 0) {
|
||||||
strncpy(vorwahl, unknown[i].num + 2 + prefix, l - (2 + prefix));
|
Strncpy(vorwahl, unknown[i].num + 2 + prefix, l - (2 + prefix) + 1);
|
||||||
vorwahl[l - (2 + prefix)] = 0;
|
vorwahl[l - (2 + prefix)] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -19,6 +19,29 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.22 1998/09/26 18:30:30 akool
|
||||||
|
* - quick and dirty Call-History in "-m" Mode (press "h" for more info) added
|
||||||
|
* - eat's one more socket, Stefan: sockets[3] now is STDIN, FIRST_DESCR=4 !!
|
||||||
|
* - Support for tesion)) Baden-Wuerttemberg Tarif
|
||||||
|
* - more Providers
|
||||||
|
* - Patches from Wilfried Teiken <wteiken@terminus.cl-ki.uni-osnabrueck.de>
|
||||||
|
* - better zone-info support in "tools/isdnconf.c"
|
||||||
|
* - buffer-overrun in "isdntools.c" fixed
|
||||||
|
* - big Austrian Patch from Michael Reinelt <reinelt@eunet.at>
|
||||||
|
* - added $(DESTDIR) in any "Makefile.in"
|
||||||
|
* - new Configure-Switches "ISDN_AT" and "ISDN_DE"
|
||||||
|
* - splitted "takt.c" and "tools.c" into
|
||||||
|
* "takt_at.c" / "takt_de.c" ...
|
||||||
|
* "tools_at.c" / "takt_de.c" ...
|
||||||
|
* - new feature
|
||||||
|
* CALLFILE = /var/log/caller.log
|
||||||
|
* CALLFMT = %b %e %T %N7 %N3 %N4 %N5 %N6
|
||||||
|
* in "isdn.conf"
|
||||||
|
* - ATTENTION:
|
||||||
|
* 1. "isdnrep" dies with an seg-fault, if not HTML-Mode (Stefan?)
|
||||||
|
* 2. "isdnlog/Makefile.in" now has hardcoded "ISDN_DE" in "DEFS"
|
||||||
|
* should be fixed soon
|
||||||
|
*
|
||||||
* Revision 1.21 1998/06/07 21:03:26 akool
|
* Revision 1.21 1998/06/07 21:03:26 akool
|
||||||
* Renamed old to new zone-names (CityCall, RegioCall, GermanCall, GlobalCall)
|
* Renamed old to new zone-names (CityCall, RegioCall, GermanCall, GlobalCall)
|
||||||
*
|
*
|
||||||
|
@ -275,9 +298,9 @@ char *expand_number(char *s)
|
||||||
{
|
{
|
||||||
int all_allowed = 0;
|
int all_allowed = 0;
|
||||||
char *Ptr;
|
char *Ptr;
|
||||||
int Index;
|
int Index = 0;
|
||||||
char Help[SHORT_STRING_SIZE];
|
char Help[NUMBER_SIZE] = "";
|
||||||
static char Num[SHORT_STRING_SIZE];
|
static char Num[NUMBER_SIZE];
|
||||||
|
|
||||||
|
|
||||||
Help[0] = '\0';
|
Help[0] = '\0';
|
||||||
|
@ -291,12 +314,17 @@ char *expand_number(char *s)
|
||||||
|
|
||||||
if (*Ptr == '+')
|
if (*Ptr == '+')
|
||||||
{
|
{
|
||||||
strcpy(Help,countryprefix);
|
Strncpy(Help,countryprefix,NUMBER_SIZE);
|
||||||
Ptr++;
|
Ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Index = strlen(Help);
|
||||||
|
|
||||||
while(*Ptr != '\0')
|
while(*Ptr != '\0')
|
||||||
{
|
{
|
||||||
|
if (*Ptr == ',' || Index >= NUMBER_SIZE)
|
||||||
|
break;
|
||||||
|
|
||||||
if (isdigit(*Ptr) || *Ptr == '?' || *Ptr == '*'||
|
if (isdigit(*Ptr) || *Ptr == '?' || *Ptr == '*'||
|
||||||
*Ptr == '[' || *Ptr == ']' || all_allowed )
|
*Ptr == '[' || *Ptr == ']' || all_allowed )
|
||||||
{
|
{
|
||||||
|
@ -306,14 +334,14 @@ char *expand_number(char *s)
|
||||||
if (*Ptr == ']')
|
if (*Ptr == ']')
|
||||||
all_allowed = 0;
|
all_allowed = 0;
|
||||||
|
|
||||||
Index = strlen(Help);
|
Help[Index++] = *Ptr;
|
||||||
Help[Index] = *Ptr;
|
|
||||||
Help[Index+1] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr++;
|
Ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Help[Index] = '\0';
|
||||||
|
|
||||||
if (Help[0] == '\0')
|
if (Help[0] == '\0')
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
|
@ -717,7 +745,7 @@ char *get_areacode(char *code, int *Len, int flag)
|
||||||
{
|
{
|
||||||
char *ptr = expand_number(code);
|
char *ptr = expand_number(code);
|
||||||
|
|
||||||
if ((code = alloca(strlen(ptr))) == NULL)
|
if ((code = alloca(strlen(ptr)+1)) == NULL)
|
||||||
print_msg("Can not allocate memory!\n");
|
print_msg("Can not allocate memory!\n");
|
||||||
|
|
||||||
strcpy(code,ptr);
|
strcpy(code,ptr);
|
||||||
|
@ -1038,8 +1066,8 @@ const char* area_diff_string(char* number1, char* number2)
|
||||||
int area_diff(char* _code, char *_diffcode)
|
int area_diff(char* _code, char *_diffcode)
|
||||||
{
|
{
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
char code[40];
|
char code[NUMBER_SIZE];
|
||||||
char diffcode[40];
|
char diffcode[NUMBER_SIZE];
|
||||||
char value[15];
|
char value[15];
|
||||||
int index;
|
int index;
|
||||||
int number;
|
int number;
|
||||||
|
@ -1052,11 +1080,11 @@ int area_diff(char* _code, char *_diffcode)
|
||||||
|
|
||||||
if (_code == NULL)
|
if (_code == NULL)
|
||||||
{
|
{
|
||||||
strcpy(code,mycountry);
|
Strncpy(code,mycountry,NUMBER_SIZE);
|
||||||
strcat(code,myarea);
|
Strncat(code,myarea,NUMBER_SIZE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(code,expand_number(_code));
|
Strncpy(code,expand_number(_code),NUMBER_SIZE);
|
||||||
|
|
||||||
if (strncmp(mycountry,code,strlen(mycountry)))
|
if (strncmp(mycountry,code,strlen(mycountry)))
|
||||||
return AREA_UNKNOWN;
|
return AREA_UNKNOWN;
|
||||||
|
@ -1064,7 +1092,7 @@ int area_diff(char* _code, char *_diffcode)
|
||||||
if (_diffcode == NULL)
|
if (_diffcode == NULL)
|
||||||
return AREA_ERROR;
|
return AREA_ERROR;
|
||||||
else
|
else
|
||||||
strcpy(diffcode,expand_number(_diffcode));
|
Strncpy(diffcode,expand_number(_diffcode),NUMBER_SIZE);
|
||||||
|
|
||||||
if ((index = area_get_index(code)) == -1)
|
if ((index = area_get_index(code)) == -1)
|
||||||
return AREA_ERROR;
|
return AREA_ERROR;
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.9 1998/05/11 19:43:51 luethje
|
||||||
|
* Some changes for "vorwahlen.dat"
|
||||||
|
*
|
||||||
* Revision 1.8 1998/05/10 22:12:04 luethje
|
* Revision 1.8 1998/05/10 22:12:04 luethje
|
||||||
* Added support for VORWAHLEN2.EXE
|
* Added support for VORWAHLEN2.EXE
|
||||||
*
|
*
|
||||||
|
@ -63,7 +66,13 @@ extern char *basename __P((__const char *__name));
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
#define CONFDIR_VAR "ISDN_CONF_PATH"
|
#ifndef NUMBER_SIZE
|
||||||
|
# define NUMBER_SIZE 40
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFDIR_VAR
|
||||||
|
# define CONFDIR_VAR "ISDN_CONF_PATH"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define C_SLASH '/'
|
#define C_SLASH '/'
|
||||||
/* #define C_SLASH '\\' */
|
/* #define C_SLASH '\\' */
|
||||||
|
|
|
@ -18,6 +18,11 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.6 1997/05/09 23:31:09 luethje
|
||||||
|
* isdnlog: new switch -O
|
||||||
|
* isdnrep: new format %S
|
||||||
|
* bugfix in handle_runfiles()
|
||||||
|
*
|
||||||
* Revision 1.5 1997/04/15 00:20:18 luethje
|
* Revision 1.5 1997/04/15 00:20:18 luethje
|
||||||
* replace variables: some bugfixes, README comleted
|
* replace variables: some bugfixes, README comleted
|
||||||
*
|
*
|
||||||
|
@ -645,3 +650,28 @@ char *int2str(int value, int prec)
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
char *Strncat(char *dest, const char *src, int len)
|
||||||
|
{
|
||||||
|
int destlen = strlen(dest);
|
||||||
|
|
||||||
|
return Strncpy(dest+destlen,src,len-destlen);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
char *Strncpy(char *dest, const char *src, int len)
|
||||||
|
{
|
||||||
|
int l = strlen(src);
|
||||||
|
|
||||||
|
if (l > len - 1)
|
||||||
|
l = len - 1;
|
||||||
|
|
||||||
|
strncpy(dest,src,l);
|
||||||
|
|
||||||
|
dest[l] = '\0';
|
||||||
|
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.6 1997/05/09 23:31:10 luethje
|
||||||
|
* isdnlog: new switch -O
|
||||||
|
* isdnrep: new format %S
|
||||||
|
* bugfix in handle_runfiles()
|
||||||
|
*
|
||||||
* Revision 1.5 1997/04/15 00:20:19 luethje
|
* Revision 1.5 1997/04/15 00:20:19 luethje
|
||||||
* replace variables: some bugfixes, README comleted
|
* replace variables: some bugfixes, README comleted
|
||||||
*
|
*
|
||||||
|
@ -100,6 +105,8 @@ _EXTERN int is_double (char *string, double *value);
|
||||||
_EXTERN int is_integer (char *string, long int *value);
|
_EXTERN int is_integer (char *string, long int *value);
|
||||||
_EXTERN char *Replace_Variable(char *String);
|
_EXTERN char *Replace_Variable(char *String);
|
||||||
_EXTERN char *int2str(int value, int prec);
|
_EXTERN char *int2str(int value, int prec);
|
||||||
|
_EXTERN char *Strncpy(char *dest, const char *src, int len);
|
||||||
|
_EXTERN char *Strncat(char *dest, const char *src, int len);
|
||||||
|
|
||||||
#undef _EXTERN
|
#undef _EXTERN
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue