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

R=rsc
CC=golang-dev
https://golang.org/cl/186279
This commit is contained in:
Dean Prichard 2010-01-22 16:59:17 -08:00 committed by Russ Cox
parent 31fb879ec2
commit 07d3e0dce4
5 changed files with 8 additions and 3 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {