tchanges from rob - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 2e65dc0d024b01f99995983575317ff95cce1755
parent 515bd9ec76a7990c6719ab2ff42655b88a064c8d
Author: rsc 
Date:   Tue, 11 Jan 2005 16:48:35 +0000

changes from rob

Diffstat:
  M src/cmd/plot/libplot/machdep.c      |       3 ++-
  M src/cmd/plot/libplot/subr.c         |       8 +-------

2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/cmd/plot/libplot/machdep.c b/src/cmd/plot/libplot/machdep.c
t@@ -68,7 +68,8 @@ void m_initialize(char *s){
         int dx, dy;
         USED(s);
         if(first){
-                initdraw(0,0,"plot");
+                if(initdraw(0,0,"plot") < 0)
+                        sysfatal("plot: can't open display: %r");
                 einit(Emouse);
                 clipminx=mapminx=screen->r.min.x+4;
                 clipminy=mapminy=screen->r.min.y+4;
diff --git a/src/cmd/plot/libplot/subr.c b/src/cmd/plot/libplot/subr.c
t@@ -18,16 +18,10 @@ bcolor(char *s){
                 switch (*s) {
                 case '0': case '1': case '2': case '3': case '4':
                 case '5': case '6': case '7': case '8': case '9':
-                        c=0;
-                        while('0'<=*s && *s<='9')
-                                c=c*10+*s++-'0';
-                        if(c < 0)
-                                return DBlack;
-                        return cmap2rgba(c);
+                        return strtoul(s, 0, 0);
                 case 'k':  case 'z':        /* zero was old name for kblack */
                         return(DBlack);
                 case 'r':
-print("RED");
                         return(DRed);
                 case 'g': 
                         return(DGreen);