]> granicus.if.org Git - graphviz/commitdiff
stop relying on pointers-as-IDs to retrieve strings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Aug 2020 19:05:08 +0000 (12:05 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Aug 2020 01:48:49 +0000 (18:48 -0700)
Now that strings are always stored in the internal map, they can be retrieved
from there instead of relying on the assumption that the ID aliases the name of
an entity. Related to #1767.

lib/cgraph/id.c

index f64e58ebcb78dbab8d1be0849031cb7fa859258e..14804d2c4c1a3add050500956e60d9dcb83152fd 100644 (file)
@@ -63,10 +63,8 @@ static char *idprint(void *state, int objtype, IDTYPE id)
 {
     NOTUSED(state);
     NOTUSED(objtype);
-    if (id % 2 == 0)
-       return (char *) id;
-    else
-       return NILstr;
+    NOTUSED(id);
+    return NILstr;
 }
 
 static void idclose(void *state)