$NetBSD: patch-bg,v 1.1 2005/10/17 20:18:34 is Exp $ --- rts/conv.c.orig 1999-07-28 22:42:24.000000000 +0200 +++ rts/conv.c @@ -219,11 +219,30 @@ mpd_ptrval (locn, s) char *locn; String *s; { + unsigned long ul; + char c[2], d[2]; + int t; + mpd_check_stk (CUR_STACK); - if (s->length == 8 && strncmp (DATA (s), "==null==", 8) == 0) - return 0; - else - return (Ptr) mpd_intval (locn, s); + + if (s->length == 8 && strncmp (DATA (s), "==null==", 8) == 0) { + return (Ptr)0; + } + /* implicit else */ + + c[0] = '\0'; + DATA (s) [s->length] = '\0'; + + t = sscanf (DATA (s), "%lx%1s%1s", &ul, c, d); + + if ( t != 1 && + (t != 2 || (c[0] != 'x' && c[0] != 'X'))) { + + mpd_runerr (locn, E_PCNV, s); + } + + return (Ptr) ul; + }