[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lynx-dev
Subject:    Re: lynx-dev was: def7_uni problem
From:       Serge MUNHOVEN <munhoven () mema ! ucl ! ac ! be>
Date:       1998-10-23 18:03:07
[Download RAW message or body]

On Fri, Oct 23, 1998 at 11:27:36AM +0400, Leonid Pauzner wrote:
 >  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.
 >  
Congratulations !

Well you really can call this *unpredictable*. E.g., in my case
        printf("%3d", unicount[i]);
was not executed. But duplicate it to stderr for debugging :
        printf("%3d", unicount[i]);
        fprintf(stderr, "%3d", unicount[i]);
along with the other printf statements, and you will end up with a broken
*file* def7_uni.h, but correct output on your *terminal*.

Anyway Leonid is right, and since
        *id_append = '\0';
for the default map, it should be save to move
        id_append[i+1] = '\0';
up into the else branch. This fixes the problem in my case.

Thanks a lot,

 - Serge

-- 
 Serge Munhoven                              Internet: munhoven@mema.ucl.ac.be

["makeuctb.c.diff" (text/plain)]

*** makeuctb.c.orig	Tue 20 Oct 19:35:38 1998
--- makeuctb.c	Fri 23 Oct 19:31:39 1998
***************
*** 660,667 ****
  	     p++, i++) {
  	    id_append[i+1] = isalnum(*p) ? *p : '_';
  	}
      }
-     id_append[i+1] = '\0';
      fprintf(stderr, " (%s).\n", id_append);
  
      printf("\
--- 660,667 ----
  	     p++, i++) {
  	    id_append[i+1] = isalnum(*p) ? *p : '_';
  	}
+         id_append[i+1] = '\0';
      }
      fprintf(stderr, " (%s).\n", id_append);
  
      printf("\


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic