c93488d7da
- works per the specification and - works on LP64 machines as well as ILP32 machines. Designed to work anywhere where sizeof(L) >= sizeof(P). Cannot use %p, as we want to feed back the patch to the SR people, who maintain SR also on some very old systems.
39 lines
786 B
Text
39 lines
786 B
Text
$NetBSD: patch-bg,v 1.1 2005/03/12 10:22:08 is Exp $
|
|
|
|
--- rts/conv.c.orig 1999-07-28 22:42:24.000000000 +0200
|
|
+++ rts/conv.c
|
|
@@ -219,11 +219,30 @@ sr_ptrval (locn, s)
|
|
char *locn;
|
|
String *s;
|
|
{
|
|
+ unsigned long ul;
|
|
+ char c[2], d[2];
|
|
+ int t;
|
|
+
|
|
sr_check_stk (CUR_STACK);
|
|
- if (s->length == 8 && strncmp (DATA (s), "==null==", 8) == 0)
|
|
- return 0;
|
|
- else
|
|
- return (Ptr) sr_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'))) {
|
|
+
|
|
+ sr_runerr (locn, E_PCNV, s);
|
|
+ }
|
|
+
|
|
+ return (Ptr) ul;
|
|
+
|
|
}
|
|
|
|
|