[comp.os.minix] PRINTK

mark@cs.vu.nl (Rooi de M) (07/03/87)

Line 14 in file printk.c says
			int *valp;
Line 43:
			case 's':	p = (char *) *valp++; 

This increments 'valp' with the size of an integer,  where it should be
incremented by the size of a pointer.  When these sizes differ, as with
the ACK m68k2 backend I am using to port minix to the Atari 1040,
things go wrong.  The fix is easy: Use an extra variable 'pp',
similar in function to 'lp', as follows:

	long l, *lp;
	char **pp;

	lp = (long *) valp;
	pp = (char **) valp;

	.
	.
	.
	case 's':	p = *pp++; valp = (int *)pp;