bigger buffer
This commit is contained in:
parent
0870ded11f
commit
7575a9e1bb
1 changed files with 4 additions and 4 deletions
|
|
@ -700,11 +700,11 @@ int is_valid_label(char* lab)
|
||||||
*/
|
*/
|
||||||
fpolygon* rd_fpoly(FILE* fin, int *lineno)
|
fpolygon* rd_fpoly(FILE* fin, int *lineno)
|
||||||
{
|
{
|
||||||
char buf[256], junk[2];
|
char buf[1024], junk[2];
|
||||||
fpoint q;
|
fpoint q;
|
||||||
fpolygon* fp;
|
fpolygon* fp;
|
||||||
int allocn;
|
int allocn;
|
||||||
if (!fgets(buf,256,fin))
|
if (!fgets(buf,sizeof buf,fin))
|
||||||
return 0;
|
return 0;
|
||||||
(*lineno)++;
|
(*lineno)++;
|
||||||
if (sscanf(buf,"%lg%lg%1s",&q.x,&q.y,junk) != 2)
|
if (sscanf(buf,"%lg%lg%1s",&q.x,&q.y,junk) != 2)
|
||||||
|
|
@ -717,7 +717,7 @@ fpolygon* rd_fpoly(FILE* fin, int *lineno)
|
||||||
fp->nam = "";
|
fp->nam = "";
|
||||||
fp->thick = 0;
|
fp->thick = 0;
|
||||||
fp->clr = clr_im(DBlack);
|
fp->clr = clr_im(DBlack);
|
||||||
while (fgets(buf,256,fin)) {
|
while (fgets(buf,sizeof buf,fin)) {
|
||||||
(*lineno)++;
|
(*lineno)++;
|
||||||
if (sscanf(buf,"%lg%lg%1s",&q.x,&q.y,junk) != 2) {
|
if (sscanf(buf,"%lg%lg%1s",&q.x,&q.y,junk) != 2) {
|
||||||
if (!is_valid_label(buf))
|
if (!is_valid_label(buf))
|
||||||
|
|
@ -784,7 +784,7 @@ fpolygon* fp_reverse(fpolygon* fp)
|
||||||
|
|
||||||
void wr_fpoly(FILE* fout, const fpolygon* fp)
|
void wr_fpoly(FILE* fout, const fpolygon* fp)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[1024];
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<=fp->n; i++)
|
for (i=0; i<=fp->n; i++)
|
||||||
fprintf(fout,"%.12g\t%.12g\n", fp->p[i].x, fp->p[i].y);
|
fprintf(fout,"%.12g\t%.12g\n", fp->p[i].x, fp->p[i].y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue