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

Re: Still problems with boot-floppies



At Sat, 6 Nov 1999 23:51:43 +0100,
Martin Schulze <joey@finlandia.Infodrom.North.DE> wrote:

> At least one cause of problems is that some tools (like strlen() for
> example) are failing on NULL pointers.  It's not that the NULL-string
> gets to newt, the system crashes before that.
> 
> Thus, pointerize must NOT return any NULL pointer or we need to
> check for NULL pointers on our own.  This would be silly as it 
> would mean that we would have to include all strings in the source
> again - one reason why pointerize was inveneted, I guess.

Hmm, I'm afraid that we must maintain translation database, in order to
make sure that translation[] is not NULL and to keep out original strings 
from source...

> Instead of
> 
>          msg = (translation[94]);
> 
> we would have to use
> 
>          msg = (translation[94])?translation[94]:"The original string";


Well, how about this patch?

--- pointerize-0.3/src/pointerize.c.orig	Sat Jun 19 19:29:31 1999
+++ pointerize-0.3/src/pointerize.c	Sun Nov  7 18:07:04 1999
@@ -899,7 +899,9 @@
        case token_type_string_literal:
 	 if (state == 2)
 	 {
-	   printf ("("VARNAME"[%d]",getidx(token.string));
+	   printf ("("VARNAME"[%d]?"VARNAME"[%d]:%s",
+			getidx(token.string),
+			getidx(token.string), token.buffer);
 	   free (token.buffer);
 	   free (token.string);
 	 }

Best regards,
Fumitoshi UKAI


Reply to: