From: Matthew Fernandez Date: Sun, 3 Jan 2021 01:49:25 +0000 (-0800) Subject: remove a use of sfstropen in GVPR X-Git-Tag: 2.47.0~4^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f964a0fd54bec2a100d8603b86c9b464eeacedf8;p=graphviz remove a use of sfstropen in GVPR Related to #1873. --- diff --git a/lib/gvpr/actions.c b/lib/gvpr/actions.c index ce4bb2997..0f939dbab 100644 --- a/lib/gvpr/actions.c +++ b/lib/gvpr/actions.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #define KINDS(p) ((AGTYPE(p) == AGRAPH) ? "graph" : (AGTYPE(p) == AGNODE) ? "node" : "edge") @@ -701,20 +702,20 @@ char *readLine(Expr_t * ex, int fd) { Sfio_t *sp; int c; - Sfio_t *tmps; + agxbuf tmps; char *line; if (fd < 0 || fd >= elementsof(ex->file) || !((sp = ex->file[fd]))) { exerror("readL: %d: invalid descriptor", fd); return ""; } - tmps = sfstropen(); + agxbinit(&tmps, 0, NULL); while ((c = sfgetc(sp)) > 0 && c != '\n') - sfputc(tmps, c); + agxbputc(&tmps, c); if (c == '\n') - sfputc(tmps, c); - line = exstring(ex, sfstruse(tmps)); - sfclose(tmps); + agxbputc(&tmps, c); + line = exstring(ex, agxbuse(&tmps)); + agxbfree(&tmps); return line; }