Compare commits

...

4 Commits
master ... zx

Author SHA1 Message Date
d5b3905528
strncasecmp in nodelist find (prelim)
All checks were successful
Altlinux build / build-alt (push) Successful in 2m44s
Archlinux build / build-arch (push) Successful in 3m0s
Archlinux build / make-test (push) Successful in 57s
Debian build / build-ubuntu (push) Successful in 3m46s
2025-05-02 23:16:22 +03:00
07b64ce968 Minor fixes
All checks were successful
Altlinux build / build-alt (push) Successful in 2m39s
Archlinux build / build-arch (push) Successful in 3m4s
Archlinux build / make-test (push) Successful in 1m1s
Debian build / build-ubuntu (push) Successful in 3m50s
2025-05-02 00:16:29 +03:00
2a1f00c21f Fix clear flags on points in nlookup if none
All checks were successful
Altlinux build / build-alt (push) Successful in 2m44s
Archlinux build / build-arch (push) Successful in 2m58s
Archlinux build / make-test (push) Successful in 56s
Debian build / build-ubuntu (push) Successful in 3m49s
2025-05-01 23:51:45 +03:00
a387668a26 Fix clear flags on points in nlookup if none
All checks were successful
Altlinux build / build-alt (push) Successful in 2m44s
Archlinux build / build-arch (push) Successful in 3m2s
Archlinux build / make-test (push) Successful in 1m1s
Debian build / build-ubuntu (push) Successful in 3m48s
2025-05-01 21:00:40 +03:00
9 changed files with 38 additions and 29 deletions

View File

@ -302,3 +302,6 @@ Alexey Khromov (zx@zxalexis.ru)
* INA in hidden flags sets remote address, protoflags change protocols
* ipaddr in hidden flags overwrites original and has max priority
* phone in hidden lines do not affect ip callout in case without flags
0.27.1
+ Fixed clear flags in nlookup when none of them

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
bforce (0.27.1) UNRELEASED; urgency=medium
* Fixed clear flags on points in nlookup if none
-- Alexey Khromov <zx@zxalexis.ru> Thu, 01 May 2025 22:19:54 +0300
bforce (0.27) UNRELEASED; urgency=medium
* Fixed warnings from PVS-Studio analyser

View File

@ -1,6 +1,6 @@
Summary: Bforce, Fidonet mailer
Name: bforce
Version: 0.27
Version: 0.27.1
Release: %{_vendor}1
Copyright: GPL
Group: Fidonet/mailer

View File

@ -1 +1 @@
0.27
0.27.1

View File

@ -219,18 +219,23 @@ int nodelist_parsepoint(s_node *node, char *str)
cnt = string_parse(argv, NODELIST_POSFLAGS+1, str, ',');
if( cnt < NODELIST_POSFLAGS-1 )
return -1;
DEB((D_NODELIST,"nodelist: parsepoint OK: %d", cnt));
//DEB((D_NODELIST,"nodelist: parsepoint OK: %d", cnt));
strnxcpy(node->name, argv[NODELIST_POSNAME], sizeof(node->name));
DEB((D_NODELIST,"nodelist: parsepoint sys: %s", node->name));
//DEB((D_NODELIST,"nodelist: parsepoint sys: %s", node->name));
strnxcpy(node->location, argv[NODELIST_POSLOCATION], sizeof(node->location));
DEB((D_NODELIST,"nodelist: parsepoint loc: %s", node->location));
//DEB((D_NODELIST,"nodelist: parsepoint loc: %s", node->location));
strnxcpy(node->sysop, argv[NODELIST_POSSYSOP], sizeof(node->sysop));
DEB((D_NODELIST,"nodelist: parsepoint zyz: %s", node->sysop));
//DEB((D_NODELIST,"nodelist: parsepoint zyz: %s", node->sysop));
strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone));
DEB((D_NODELIST,"nodelist: parsepoint pho: %s", node->phone));
//DEB((D_NODELIST,"nodelist: parsepoint pho: %s", node->phone));
if (argv[NODELIST_POSFLAGS])
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
DEB((D_NODELIST,"nodelist: parsepoint fl: %s", node->flags));
else {
//DEB((D_NODELIST,"nodelist: no flags"));
//memset(node->flags,'\0',sizeof(node->flags));
strnxcpy(node->flags, "<no flags>", sizeof(node->flags));
}
//DEB((D_NODELIST,"nodelist: parsepoint fl: %s", node->flags));
if (argv[NODELIST_POSSPEED])
node->speed = atoi(argv[NODELIST_POSSPEED]);
DEB((D_NODELIST, "nodelist: Parsed common values SYS: %s, ZYZ: %s, LOC: %s, PHONE: %s", node->name, node->sysop, node->location, node->phone));
@ -296,7 +301,10 @@ int nodelist_parsestring(s_node *node, char *str)
strnxcpy(node->location, argv[NODELIST_POSLOCATION], sizeof(node->location));
strnxcpy(node->sysop, argv[NODELIST_POSSYSOP], sizeof(node->sysop));
strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone));
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
if (argv[NODELIST_POSFLAGS])
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
else
memset(node->flags,'\0',sizeof(node->flags));
node->speed = atoi(argv[NODELIST_POSSPEED]);
DEB((D_NODELIST, "nodelist: Parsed common values SYS: %s, ZYZ: %s, LOC: %s, PHONE: %s", node->name, node->sysop, node->location, node->phone));
/*
@ -513,6 +521,7 @@ s_nodelist *nodelist_open(const char *dir, char *name, int mode)
if( strlen(tmpseek) == strlen(tmpname) )
{
// strncasecmp?
if( (strncmp(tmpseek, tmpname, strlen(tmpseek)-3 ) == 0) )
{
@ -533,7 +542,7 @@ s_nodelist *nodelist_open(const char *dir, char *name, int mode)
closedir(ndirstream);
}
}
// strncasecmp? - seems to be hardcoded '999'
if( strcmp(name+strlen(name)-4, ".999") == 0 )
/* we haven`t found any nodelist for this mask */
{
@ -718,9 +727,7 @@ int nodelist_putindex(s_nodelist *nlp, const s_bni *bni)
buffer_putint(buffer + 6, bni->point);
buffer_putint(buffer + 8, bni->hub);
buffer_putlong(buffer + 10, bni->offset);
if (bni->point != 0) {
DEB((D_NODELIST, "nodelist: findindex found point z: %d, n: %d, l: %d, p: %d, offset: %l", bni->zone, bni->net, bni->node, bni->point, bni->offset));
}
if( fwrite(buffer, sizeof(buffer), 1, nlp->fp_index) != 1 )
{
logerr("error writing nodelist index file \"%s\"", nlp->name_index);
@ -755,10 +762,6 @@ int nodelist_findindex(s_nodelist *nlp, s_bni *bni, s_faddr addr)
bni->point = buffer_getint(p + 6);
bni->hub = buffer_getint(p + 8);
bni->offset = buffer_getlong(p + 10);
if ((uint32_t)nlp->endian == 0xBEEFDEAD) {
swap_long((char *)&bni->offset);
}
DEB((D_NODELIST, "nodelist: findindex found" ));
return 0;
}
p += NODELIST_ENTRYSIZE;

View File

@ -311,15 +311,6 @@ int buffer_getint(const char *buffer)
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 );
}
void swap_long(char *buffer){
char *temp = xmemcpy(buffer, sizeof(uint32_t));
temp[0] = buffer[2];
temp[1] = buffer[3];
temp[2] = buffer[0];
temp[3] = buffer[1];
memcpy(buffer,temp,sizeof(uint32_t));
}
void printf_usage(const char *ident, const char *fmt, ...)
{
va_list args;

View File

@ -223,6 +223,12 @@ char *string_chomp(char *str)
if( *str )
{
for (p = str; p < (str + strlen(str)); p++){
if( *p == '\n')
*p = '\0';
if( *p == '\r')
*p = '\0';
}
p = str + strlen(str + 1);
if( *p == '\n' )
*p-- = '\0';
@ -613,8 +619,8 @@ int string_parse(char **dest, int items, char *str, int separator)
if( *((unsigned char *)p) == separator )
{
*p++ = '\0';
// DEB((D_INDEX,"Parsed string: %s", dest[count]));
dest[count++] = p;
//DEB((D_NODELIST,"Parsed string: %s", dest[count-1]));
} else
++p;
}

View File

@ -71,7 +71,8 @@ void print_nodeinfo(const s_node *node)
printf("Sysop : %s\n", node->sysop);
printf("Location : %s\n", node->location);
printf("Speed : %ld\n", node->speed);
printf("Flags : %s\n", node->flags);
if (node->flags)
printf("Flags : %s\n", node->flags);
if( node->worktime.num )
{

View File

@ -189,7 +189,6 @@ char *buffer_putlong(char *buffer, long val);
char *buffer_putint(char *buf, int val);
long buffer_getlong(const char *buf);
int buffer_getint(const char *buf);
void swap_long(char *buffer);
void printf_usage(const char *ident, const char *fmt, ...);