aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/plot
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-11 16:48:35 +0000
committerrsc <devnull@localhost>2005-01-11 16:48:35 +0000
commit2e65dc0d024b01f99995983575317ff95cce1755 (patch)
tree66837ff157985946912820167b09c725374306ca /src/cmd/plot
parent515bd9ec76a7990c6719ab2ff42655b88a064c8d (diff)
downloadplan9port-2e65dc0d024b01f99995983575317ff95cce1755.tar.gz
plan9port-2e65dc0d024b01f99995983575317ff95cce1755.tar.bz2
plan9port-2e65dc0d024b01f99995983575317ff95cce1755.zip
changes from rob
Diffstat (limited to 'src/cmd/plot')
-rw-r--r--src/cmd/plot/libplot/machdep.c3
-rw-r--r--src/cmd/plot/libplot/subr.c8
2 files changed, 3 insertions, 8 deletions
diff --git a/src/cmd/plot/libplot/machdep.c b/src/cmd/plot/libplot/machdep.c
index 4f60dccc..da7077aa 100644
--- a/src/cmd/plot/libplot/machdep.c
+++ b/src/cmd/plot/libplot/machdep.c
@@ -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
index 48078ed6..eb0b5130 100644
--- a/src/cmd/plot/libplot/subr.c
+++ b/src/cmd/plot/libplot/subr.c
@@ -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);