mirror of
https://github.com/golang/go
synced 2024-11-26 00:57:56 -07:00
5a/6a/8a: avoid fixed-sized file name buffer
R=rsc CC=golang-dev https://golang.org/cl/186279
This commit is contained in:
parent
31fb879ec2
commit
07d3e0dce4
@ -139,9 +139,10 @@ main(int argc, char *argv[])
|
|||||||
int
|
int
|
||||||
assemble(char *file)
|
assemble(char *file)
|
||||||
{
|
{
|
||||||
char ofile[100], incfile[20], *p;
|
char *ofile, incfile[20], *p;
|
||||||
int i, of;
|
int i, of;
|
||||||
|
|
||||||
|
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
|
||||||
strcpy(ofile, file);
|
strcpy(ofile, file);
|
||||||
p = utfrrune(ofile, '/');
|
p = utfrrune(ofile, '/');
|
||||||
if(p) {
|
if(p) {
|
||||||
|
@ -168,6 +168,7 @@ EXTERN char* thestring;
|
|||||||
EXTERN int32 thunk;
|
EXTERN int32 thunk;
|
||||||
EXTERN Biobuf obuf;
|
EXTERN Biobuf obuf;
|
||||||
|
|
||||||
|
void* alloc(int32);
|
||||||
void* allocn(void*, int32, int32);
|
void* allocn(void*, int32, int32);
|
||||||
void errorexit(void);
|
void errorexit(void);
|
||||||
void pushio(void);
|
void pushio(void);
|
||||||
|
@ -139,9 +139,10 @@ main(int argc, char *argv[])
|
|||||||
int
|
int
|
||||||
assemble(char *file)
|
assemble(char *file)
|
||||||
{
|
{
|
||||||
char ofile[100], incfile[20], *p;
|
char *ofile, incfile[20], *p;
|
||||||
int i, of;
|
int i, of;
|
||||||
|
|
||||||
|
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
|
||||||
strcpy(ofile, file);
|
strcpy(ofile, file);
|
||||||
p = utfrrune(ofile, pathchar());
|
p = utfrrune(ofile, pathchar());
|
||||||
if(p) {
|
if(p) {
|
||||||
|
@ -169,6 +169,7 @@ EXTERN char* thestring;
|
|||||||
EXTERN int32 thunk;
|
EXTERN int32 thunk;
|
||||||
EXTERN Biobuf obuf;
|
EXTERN Biobuf obuf;
|
||||||
|
|
||||||
|
void* alloc(int32);
|
||||||
void* allocn(void*, int32, int32);
|
void* allocn(void*, int32, int32);
|
||||||
void errorexit(void);
|
void errorexit(void);
|
||||||
void pushio(void);
|
void pushio(void);
|
||||||
|
@ -138,9 +138,10 @@ main(int argc, char *argv[])
|
|||||||
int
|
int
|
||||||
assemble(char *file)
|
assemble(char *file)
|
||||||
{
|
{
|
||||||
char ofile[100], incfile[20], *p;
|
char *ofile, incfile[20], *p;
|
||||||
int i, of;
|
int i, of;
|
||||||
|
|
||||||
|
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
|
||||||
strcpy(ofile, file);
|
strcpy(ofile, file);
|
||||||
p = utfrrune(ofile, pathchar());
|
p = utfrrune(ofile, pathchar());
|
||||||
if(p) {
|
if(p) {
|
||||||
|
Loading…
Reference in New Issue
Block a user