Commit 07d3e0dc authored by Dean Prichard's avatar Dean Prichard Committed by Russ Cox

5a/6a/8a: avoid fixed-sized file name buffer

R=rsc
CC=golang-dev
https://golang.org/cl/186279
parent 31fb879e
......@@ -139,9 +139,10 @@ main(int argc, char *argv[])
int
assemble(char *file)
{
char ofile[100], incfile[20], *p;
char *ofile, incfile[20], *p;
int i, of;
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
strcpy(ofile, file);
p = utfrrune(ofile, '/');
if(p) {
......
......@@ -168,6 +168,7 @@ EXTERN char* thestring;
EXTERN int32 thunk;
EXTERN Biobuf obuf;
void* alloc(int32);
void* allocn(void*, int32, int32);
void errorexit(void);
void pushio(void);
......
......@@ -139,9 +139,10 @@ main(int argc, char *argv[])
int
assemble(char *file)
{
char ofile[100], incfile[20], *p;
char *ofile, incfile[20], *p;
int i, of;
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
strcpy(ofile, file);
p = utfrrune(ofile, pathchar());
if(p) {
......
......@@ -169,6 +169,7 @@ EXTERN char* thestring;
EXTERN int32 thunk;
EXTERN Biobuf obuf;
void* alloc(int32);
void* allocn(void*, int32, int32);
void errorexit(void);
void pushio(void);
......
......@@ -138,9 +138,10 @@ main(int argc, char *argv[])
int
assemble(char *file)
{
char ofile[100], incfile[20], *p;
char *ofile, incfile[20], *p;
int i, of;
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
strcpy(ofile, file);
p = utfrrune(ofile, pathchar());
if(p) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment