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

This commit is contained in:
Alexey Khromov 2025-05-01 21:00:40 +03:00
parent 926124dffc
commit a387668a26
3 changed files with 7 additions and 18 deletions

View File

@ -230,6 +230,8 @@ int nodelist_parsepoint(s_node *node, char *str)
DEB((D_NODELIST,"nodelist: parsepoint pho: %s", node->phone)); DEB((D_NODELIST,"nodelist: parsepoint pho: %s", node->phone));
if (argv[NODELIST_POSFLAGS]) if (argv[NODELIST_POSFLAGS])
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags)); strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
else
memset(node->flags,'\0',sizeof(node->flags));
DEB((D_NODELIST,"nodelist: parsepoint fl: %s", node->flags)); DEB((D_NODELIST,"nodelist: parsepoint fl: %s", node->flags));
if (argv[NODELIST_POSSPEED]) if (argv[NODELIST_POSSPEED])
node->speed = atoi(argv[NODELIST_POSSPEED]); node->speed = atoi(argv[NODELIST_POSSPEED]);
@ -296,7 +298,10 @@ int nodelist_parsestring(s_node *node, char *str)
strnxcpy(node->location, argv[NODELIST_POSLOCATION], sizeof(node->location)); strnxcpy(node->location, argv[NODELIST_POSLOCATION], sizeof(node->location));
strnxcpy(node->sysop, argv[NODELIST_POSSYSOP], sizeof(node->sysop)); strnxcpy(node->sysop, argv[NODELIST_POSSYSOP], sizeof(node->sysop));
strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone)); strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone));
if (argv[NODELIST_POSFLAGS])
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags)); strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
else
memset(node->flags,'\0',sizeof(node->flags));
node->speed = atoi(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)); DEB((D_NODELIST, "nodelist: Parsed common values SYS: %s, ZYZ: %s, LOC: %s, PHONE: %s", node->name, node->sysop, node->location, node->phone));
/* /*
@ -718,9 +723,7 @@ int nodelist_putindex(s_nodelist *nlp, const s_bni *bni)
buffer_putint(buffer + 6, bni->point); buffer_putint(buffer + 6, bni->point);
buffer_putint(buffer + 8, bni->hub); buffer_putint(buffer + 8, bni->hub);
buffer_putlong(buffer + 10, bni->offset); 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 ) if( fwrite(buffer, sizeof(buffer), 1, nlp->fp_index) != 1 )
{ {
logerr("error writing nodelist index file \"%s\"", nlp->name_index); logerr("error writing nodelist index file \"%s\"", nlp->name_index);
@ -755,10 +758,6 @@ int nodelist_findindex(s_nodelist *nlp, s_bni *bni, s_faddr addr)
bni->point = buffer_getint(p + 6); bni->point = buffer_getint(p + 6);
bni->hub = buffer_getint(p + 8); bni->hub = buffer_getint(p + 8);
bni->offset = buffer_getlong(p + 10); 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; return 0;
} }
p += NODELIST_ENTRYSIZE; p += NODELIST_ENTRYSIZE;

View File

@ -311,15 +311,6 @@ int buffer_getint(const char *buffer)
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 ); | ( (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, ...) void printf_usage(const char *ident, const char *fmt, ...)
{ {
va_list args; va_list args;

View File

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