2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

fix problem with alpha

This commit is contained in:
Michael Graff 2000-04-26 17:27:01 +00:00
parent f6cdcafa33
commit 88cad53724

View File

@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: gen.c,v 1.40 2000/04/25 21:10:33 explorer Exp $ */ /* $Id: gen.c,v 1.41 2000/04/26 17:27:01 explorer Exp $ */
#include <config.h> #include <config.h>
@ -429,8 +429,12 @@ HASH(char *string)
unsigned char a, b; unsigned char a, b;
n = strlen(string); n = strlen(string);
a = tolower(string[0]); if (n == 0) {
b = tolower(string[n - 1]); fprintf(stderr, "n == 0?\n");
exit(1);
}
a = tolower((unsigned char)string[0]);
b = tolower((unsigned char)string[n - 1]);
return ((a + n) * b) % 256; return ((a + n) * b) % 256;
} }
@ -650,6 +654,8 @@ main(int argc, char **argv) {
*/ */
for (j = i ; j <= 255 ; j++) { for (j = i ; j <= 255 ; j++) {
ttn2 = &typenames[j]; ttn2 = &typenames[j];
if (ttn->sorted != 0)
continue;
if (hash == HASH(ttn2->typename)) { if (hash == HASH(ttn2->typename)) {
printf("\t\t\tif (strcasecmp(\"%s\", (_typename)) == 0) { \\\n" printf("\t\t\tif (strcasecmp(\"%s\", (_typename)) == 0) { \\\n"
"\t\t\t\tif ((typeattr[%u].flags & DNS_RDATATYPEATTR_RESERVED) != 0) \\\n" "\t\t\t\tif ((typeattr[%u].flags & DNS_RDATATYPEATTR_RESERVED) != 0) \\\n"