aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/grap
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-08-17 15:32:40 +0000
committerrsc <devnull@localhost>2004-08-17 15:32:40 +0000
commit18b0811745677e0d63e3e2fa74a6b501992ef370 (patch)
tree23db07967ebb0a3bd8c7eeb598bcc7925d1ce594 /src/cmd/grap
parente3e30cff40da4c3d1c6ea56ed1cd0e136fb655c9 (diff)
downloadplan9port-18b0811745677e0d63e3e2fa74a6b501992ef370.tar.gz
plan9port-18b0811745677e0d63e3e2fa74a6b501992ef370.tar.bz2
plan9port-18b0811745677e0d63e3e2fa74a6b501992ef370.zip
fix various little bugs
Diffstat (limited to 'src/cmd/grap')
-rw-r--r--src/cmd/grap/grapl.lx2
-rw-r--r--src/cmd/grap/input.c2
-rw-r--r--src/cmd/grap/print.c10
3 files changed, 6 insertions, 8 deletions
diff --git a/src/cmd/grap/grapl.lx b/src/cmd/grap/grapl.lx
index 0023aded..6d93f083 100644
--- a/src/cmd/grap/grapl.lx
+++ b/src/cmd/grap/grapl.lx
@@ -18,7 +18,7 @@ void shell_init(void), shell_exec(void), shell_text(char *);
#define CADD cbuf[clen++] = yytext[0]; \
if (clen >= CBUFLEN-1) { \
- ERROR "string too long", cbuf WARNING; BEGIN A; }
+ ERROR "string too long" WARNING; BEGIN A; }
#define CBUFLEN 1500
char cbuf[CBUFLEN];
int clen, cflag;
diff --git a/src/cmd/grap/input.c b/src/cmd/grap/input.c
index c9c6c016..0c25bba1 100644
--- a/src/cmd/grap/input.c
+++ b/src/cmd/grap/input.c
@@ -540,7 +540,7 @@ void copy(void) /* begin input from file, etc. */
FILE *fin;
if (newfile) {
- if ((fin = fopen(unsharp(newfile), "r")) == NULL)
+ if ((fin = fopen(newfile, "r")) == NULL)
ERROR "can't open file %s", newfile FATAL;
curfile++;
curfile->fin = fin;
diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c
index 4598cb81..1ce32116 100644
--- a/src/cmd/grap/print.c
+++ b/src/cmd/grap/print.c
@@ -177,17 +177,15 @@ void do_first(void) /* done at first .G1: definitions, etc. */
{
extern int lib;
extern char *lib_defines;
- char *file;
- static char buf[50], buf1[50]; /* static because pbstr uses them */
+ static char buf[100], buf1[100]; /* static because pbstr uses them */
FILE *fp;
extern int getpid(void);
- sprintf(buf, "define pid /%d/\n", getpid());
+ snprintf(buf, sizeof buf, "define pid /%d/\n", getpid());
pbstr(buf);
if (lib != 0) {
- file = unsharp(lib_defines);
- if ((fp = fopen(file, "r")) != NULL) {
- sprintf(buf1, "copy \"%s\"\n", file);
+ if ((fp = fopen(lib_defines, "r")) != NULL) {
+ snprintf(buf1, sizeof buf, "copy \"%s\"\n", lib_defines);
pbstr(buf1);
fclose(fp);
} else {