[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev was: def7_uni problem
From: |
dickey |
Subject: |
Re: lynx-dev was: def7_uni problem |
Date: |
Fri, 23 Oct 1998 06:12:04 -0400 (EDT) |
> 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.
you're right - it makes 'i' equal to 256, which is not what was intended.
(setting it to zero looks right).
> 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';
i = 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';
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey