Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bug fixes in tag line



On Sun, 15 Mar 1998, Kestas Liaugminas wrote:

> Hi all,
> 
> 	I found the bug, which causes extended characters (\241 ...)striping in
> the tag line. The problem is in the PCFFont.c++ file. 
> 
> 511    for (const char* cp = text; *cp; cp++)
I have found that on some compilers char defaults to signed char, and on
some char defaults to unsigned char..  In this case this should probably
read as
  511	 for (const u_char* cp = (u_char *)text; *cp; cp++)
This would account for the characters > 127 being Negative...


> {                                                
> 512       u_int g =
> *cp;                                                                      
> 513       charInfo* ci = (firstCol <= g && g <= lastCol)
> ?                                    
>             encoding[g - firstCol] : cdef;
> 
> 	When *cp reaches symbol with code more than 127, it takes value <0 (I
> don't know why this happens...). Because of this (512) u_int g becomes
> undefined and condition in 513 always fail, thus resetting ci to cdef
> (default symbol, witch in most cases is space). So all international
> characters looks like blank spaces.
> 	I have some fast and ugly solution for this problem and it looks like:
> 
> 511    for (const char* cp = text; *cp; cp++)
> {                                                
> 512        int g_temp=
> *cp;                                                                    
> 513        if ( g_temp < 0) { g_temp = g_temp + 256
> ;}                                         
> 514        u_int g =
> g_temp;                                                                   
> 516        charInfo* ci = (firstCol <= g && g <= lastCol)
> ?                                    
>               encoding[g - firstCol] : cdef; 
> 
> (Sorry... C++ gurus, I need You help !!!)
> 
> 	Maybe this problem exist only on Linux systems (I have RedHat 5.0 with
> most of the patches released at this time and HylaFAX 4.0pl2)? Any help,
> ideas, patches very appreciated.
> 
> Kestas
> 



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services