summaryrefslogtreecommitdiffabout
path: root/getc.c
authorSergey Poznyakoff <gray@gnu.org.ua>2017-07-18 15:10:07 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-07-18 15:10:07 (GMT)
commitb0c0f377b5d4eb3344f22cd87171f83085eaa994 (patch) (side-by-side diff)
tree9c0bdece282348b0fe5f0a4de3fbbcc0bdffe126 /getc.c
parent24b9e009c9c2eef1b6d1accb3ac7ccc53c44c0a8 (diff)
downloadruncap-b0c0f377b5d4eb3344f22cd87171f83085eaa994.tar.gz
runcap-b0c0f377b5d4eb3344f22cd87171f83085eaa994.tar.bz2
Minor change
* runcap.h (filecapture) <fc_linestart>: Rename to fc_cur. All uses updated. * runcap.c (filecapture_put): Use fc_cur as current pointer and fc_level as the limit, for consistency. (runcap_init): Initialize fc_cur.
Diffstat (limited to 'getc.c') (more/less context) (ignore whitespace changes)
-rw-r--r--getc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/getc.c b/getc.c
index 3c203d9..fce14ea 100644
--- a/getc.c
+++ b/getc.c
@@ -34,7 +34,7 @@ runcap_getc(struct runcap *rc, int stream, char *cp)
if (!fp)
return -1;
- if (fp->fc_level == fp->fc_linestart) {
+ if (fp->fc_level == fp->fc_cur) {
if (fp->fc_tmpfd != -1) {
ssize_t r = read(fp->fc_tmpfd, fp->fc_base,
fp->fc_size);
@@ -43,12 +43,12 @@ runcap_getc(struct runcap *rc, int stream, char *cp)
else if (r == 0)
return 0;
fp->fc_level = r;
- fp->fc_linestart = 0;
+ fp->fc_cur = 0;
} else {
return 0;
}
}
- *cp = fp->fc_base[fp->fc_linestart++];
+ *cp = fp->fc_base[fp->fc_cur++];
return 1;
}

Return to:

Send suggestions and report system problems to the System administrator.