[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev was: def7_uni problem
From: |
Leonid Pauzner |
Subject: |
lynx-dev was: def7_uni problem |
Date: |
Fri, 23 Oct 1998 11:27:36 +0400 (MSD) |
Recently was discussed a problem compiling def7_uni.tbl by few people,
I look into makeuctbl.c and found a code in question (see below):
def7_uni use blank "id_append", but we have
id_append[i+1] = '\0';
outside "else" when "i" really uninitialized for default table.
So this may (probably) give an unpredictable side effect.
if (this_isDefaultMap == -1) {
this_isDefaultMap = !strncmp(this_MIMEcharset,"iso-8859-1", 10);
}
fprintf(stderr,
"makeuctb: %s: %stranslation map",
this_MIMEcharset, (this_isDefaultMap ? "default " : ""));
if (this_isDefaultMap == 1) {
*id_append = '\0';
} else {
for (i = 0, p = this_MIMEcharset;
*p && (i < UC_MAXLEN_ID_APPEND-1);
p++, i++) {
id_append[i+1] = isalnum(*p) ? *p : '_';
}
}
id_append[i+1] = '\0';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fprintf(stderr, " (%s).\n", id_append);
printf("\
/*\n\
* uni_hash.tbl\n\
*\n\
* Do not edit this file; it was automatically generated by\n\
*\n\
* %s %s\n\
*\n\
*/\n\
\n\
static u8 dfont_unicount%s[%d] = \n\
{\n\t", argv[0], argv[1], id_append, fontlen);
for (i = 0; i < fontlen; i++) {
if (i >= 128 && unicount[i] > 0 && i < lowest_eight) {
lowest_eight = i;
}
printf("%3d", unicount[i]);
if (i == (fontlen - 1)) {
printf("\n};\n");
} else if ((i % 8) == 7) {
printf(",\n\t");
} else {
printf(", ");
}
}
- lynx-dev was: def7_uni problem,
Leonid Pauzner <=