diff options
author | 2015-09-17 14:21:33 +0000 | |
---|---|---|
committer | 2015-09-17 14:21:33 +0000 | |
commit | 8c046d2474663213fa8b65bf0e2021004b6ccd6f (patch) | |
tree | 2062c8fb7b50fda966f1b2e1928bd8da42f651ad | |
parent | Redraw both src and dst sessions in break-pane. (diff) | |
download | wireguard-openbsd-8c046d2474663213fa8b65bf0e2021004b6ccd6f.tar.xz wireguard-openbsd-8c046d2474663213fa8b65bf0e2021004b6ccd6f.zip |
Remove unnecessary casts, from Michael McConville. No binary change.
-rw-r--r-- | bin/ksh/c_sh.c | 4 | ||||
-rw-r--r-- | bin/ksh/edit.c | 6 | ||||
-rw-r--r-- | bin/ksh/eval.c | 8 | ||||
-rw-r--r-- | bin/ksh/exec.c | 4 | ||||
-rw-r--r-- | bin/ksh/expand.h | 4 | ||||
-rw-r--r-- | bin/ksh/expr.c | 4 | ||||
-rw-r--r-- | bin/ksh/history.c | 4 | ||||
-rw-r--r-- | bin/ksh/io.c | 4 | ||||
-rw-r--r-- | bin/ksh/jobs.c | 6 | ||||
-rw-r--r-- | bin/ksh/lex.c | 6 | ||||
-rw-r--r-- | bin/ksh/mail.c | 4 | ||||
-rw-r--r-- | bin/ksh/main.c | 4 | ||||
-rw-r--r-- | bin/ksh/misc.c | 6 | ||||
-rw-r--r-- | bin/ksh/shf.c | 10 | ||||
-rw-r--r-- | bin/ksh/syn.c | 10 | ||||
-rw-r--r-- | bin/ksh/table.c | 8 | ||||
-rw-r--r-- | bin/ksh/tree.c | 14 | ||||
-rw-r--r-- | bin/ksh/var.c | 10 | ||||
-rw-r--r-- | bin/ksh/vi.c | 4 |
19 files changed, 59 insertions, 61 deletions
diff --git a/bin/ksh/c_sh.c b/bin/ksh/c_sh.c index 3d6cb9c1a6d..995a76e64b6 100644 --- a/bin/ksh/c_sh.c +++ b/bin/ksh/c_sh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_sh.c,v 1.47 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: c_sh.c,v 1.48 2015/09/17 14:21:33 nicm Exp $ */ /* * built-in Bourne commands @@ -614,7 +614,7 @@ c_set(char **wp) while (*++wp != NULL) *wp = str_save(*wp, &l->area); l->argc = wp - owp - 1; - l->argv = (char **) alloc(sizeofN(char *, l->argc+2), &l->area); + l->argv = alloc(sizeofN(char *, l->argc+2), &l->area); for (wp = l->argv; (*wp++ = *owp++) != NULL; ) ; } diff --git a/bin/ksh/edit.c b/bin/ksh/edit.c index ddc38800329..c5ae4a1d400 100644 --- a/bin/ksh/edit.c +++ b/bin/ksh/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.42 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: edit.c,v 1.43 2015/09/17 14:21:33 nicm Exp $ */ /* * Command line editing - common code @@ -473,8 +473,8 @@ x_command_glob(int flags, const char *str, int slen, char ***wordsp) int path_order = 0; int i; - info = (struct path_order_info *) - alloc(sizeof(struct path_order_info) * nwords, ATEMP); + info = alloc(sizeof(struct path_order_info) * nwords, ATEMP); + for (i = 0; i < nwords; i++) { info[i].word = words[i]; info[i].base = x_basename(words[i], NULL); diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c index 982db2098e2..e9e60e1dd10 100644 --- a/bin/ksh/eval.c +++ b/bin/ksh/eval.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.41 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: eval.c,v 1.42 2015/09/17 14:21:33 nicm Exp $ */ /* * Expansion - quoting, separation, substitution, globbing @@ -292,7 +292,7 @@ expand(char *cp, /* input word */ if (!st->next) { SubType *newst; - newst = (SubType *) alloc( + newst = alloc( sizeof(SubType), ATEMP); newst->next = (SubType *) 0; newst->prev = st; @@ -406,7 +406,7 @@ expand(char *cp, /* input word */ */ len = strlen(dp) + 1; setstr(st->var, - debunk((char *) alloc(len, ATEMP), + debunk(alloc(len, ATEMP), dp, len), KSH_UNWIND_ERROR); x.str = str_val(st->var); type = XSUB; @@ -1317,7 +1317,7 @@ alt_expand(XPtrV *wp, char *start, char *exp_start, char *end, int fdo) l1 = brace_start - start; l2 = (p - 1) - field_start; l3 = end - brace_end; - new = (char *) alloc(l1 + l2 + l3 + 1, ATEMP); + new = alloc(l1 + l2 + l3 + 1, ATEMP); memcpy(new, start, l1); memcpy(new + l1, field_start, l2); memcpy(new + l1 + l2, brace_end, l3); diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c index fdaa89b3979..e10cec2ce41 100644 --- a/bin/ksh/exec.c +++ b/bin/ksh/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.54 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: exec.c,v 1.55 2015/09/17 14:21:33 nicm Exp $ */ /* * execute command tree @@ -92,7 +92,7 @@ execute(struct op *volatile t, flags &= ~XTIME; if (t->ioact != NULL || t->type == TPIPE || t->type == TCOPROC) { - e->savefd = (short *) alloc(sizeofN(short, NUFILE), ATEMP); + e->savefd = alloc(sizeofN(short, NUFILE), ATEMP); /* initialize to not redirected */ memset(e->savefd, 0, sizeofN(short, NUFILE)); } diff --git a/bin/ksh/expand.h b/bin/ksh/expand.h index 5ea1a0ed874..cdaac6441cd 100644 --- a/bin/ksh/expand.h +++ b/bin/ksh/expand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: expand.h,v 1.7 2015/09/01 13:12:31 tedu Exp $ */ +/* $OpenBSD: expand.h,v 1.8 2015/09/17 14:21:33 nicm Exp $ */ /* * Expanding strings @@ -82,7 +82,7 @@ typedef struct XPtrV { #define XPinit(x, n) do { \ void **vp__; \ - vp__ = (void**) alloc(sizeofN(void*, n), ATEMP); \ + vp__ = alloc(sizeofN(void*, n), ATEMP); \ (x).cur = (x).beg = vp__; \ (x).end = vp__ + n; \ } while (0) diff --git a/bin/ksh/expr.c b/bin/ksh/expr.c index 2e0acdae3df..4a8b7145e69 100644 --- a/bin/ksh/expr.c +++ b/bin/ksh/expr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expr.c,v 1.25 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: expr.c,v 1.26 2015/09/17 14:21:33 nicm Exp $ */ /* * Korn expression evaluation @@ -560,7 +560,7 @@ tempvar(void) { struct tbl *vp; - vp = (struct tbl*) alloc(sizeof(struct tbl), ATEMP); + vp = alloc(sizeof(struct tbl), ATEMP); vp->flag = ISSET|INTEGER; vp->type = 0; vp->areap = ATEMP; diff --git a/bin/ksh/history.c b/bin/ksh/history.c index d392301f050..7fb796ee2a2 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.42 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: history.c,v 1.43 2015/09/17 14:21:33 nicm Exp $ */ /* * command history @@ -555,7 +555,7 @@ init_histvec(void) { if (history == (char **)NULL) { histsize = HISTORYSIZE; - history = (char **)alloc(histsize*sizeof (char *), APERM); + history = alloc(histsize*sizeof (char *), APERM); histptr = history - 1; } } diff --git a/bin/ksh/io.c b/bin/ksh/io.c index 8d16b51edaa..65c9e94faf2 100644 --- a/bin/ksh/io.c +++ b/bin/ksh/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.27 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: io.c,v 1.28 2015/09/17 14:21:33 nicm Exp $ */ /* * shell buffered IO and formatted output @@ -422,7 +422,7 @@ maketemp(Area *ap, Temp_type type, struct temp **tlist) dir = tmpdir ? tmpdir : "/tmp"; /* The 20 + 20 is a paranoid worst case for pid/inc */ len = strlen(dir) + 3 + 20 + 20 + 1; - tp = (struct temp *) alloc(sizeof(struct temp) + len, ap); + tp = alloc(sizeof(struct temp) + len, ap); tp->name = path = (char *) &tp[1]; tp->shf = (struct shf *) 0; tp->type = type; diff --git a/bin/ksh/jobs.c b/bin/ksh/jobs.c index b57ba18d43f..f12a3ddeca2 100644 --- a/bin/ksh/jobs.c +++ b/bin/ksh/jobs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jobs.c,v 1.45 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: jobs.c,v 1.46 2015/09/17 14:21:33 nicm Exp $ */ /* * Process and job control @@ -1535,7 +1535,7 @@ new_job(void) newj = free_jobs; free_jobs = free_jobs->next; } else - newj = (Job *) alloc(sizeof(Job), APERM); + newj = alloc(sizeof(Job), APERM); /* brute force method */ for (i = 1; ; i++) { @@ -1562,7 +1562,7 @@ new_proc(void) p = free_procs; free_procs = free_procs->next; } else - p = (Proc *) alloc(sizeof(Proc), APERM); + p = alloc(sizeof(Proc), APERM); return p; } diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c index cf52cd6f6b7..72ce95c81f4 100644 --- a/bin/ksh/lex.c +++ b/bin/ksh/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.52 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: lex.c,v 1.53 2015/09/17 14:21:33 nicm Exp $ */ /* * lexical analysis and source input @@ -700,7 +700,7 @@ Done: if ((c == '<' || c == '>') && state == SBASE && ((c2 = Xlength(ws, wp)) == 0 || (c2 == 2 && dp[0] == CHAR && digit(dp[1])))) { - struct ioword *iop = (struct ioword *) alloc(sizeof(*iop), ATEMP); + struct ioword *iop = alloc(sizeof(*iop), ATEMP); if (c2 == 2) iop->unit = dp[1] - '0'; @@ -921,7 +921,7 @@ pushs(int type, Area *areap) { Source *s; - s = (Source *) alloc(sizeof(Source), areap); + s = alloc(sizeof(Source), areap); s->type = type; s->str = null; s->start = NULL; diff --git a/bin/ksh/mail.c b/bin/ksh/mail.c index 73878f83fca..f4c9361ff6c 100644 --- a/bin/ksh/mail.c +++ b/bin/ksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.18 2015/09/01 13:12:31 tedu Exp $ */ +/* $OpenBSD: mail.c,v 1.19 2015/09/17 14:21:33 nicm Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -162,7 +162,7 @@ mballoc(char *p, char *m) struct stat stbuf; mbox_t *mbp; - mbp = (mbox_t *)alloc(sizeof(mbox_t), APERM); + mbp = alloc(sizeof(mbox_t), APERM); mbp->mb_next = NULL; mbp->mb_path = p; mbp->mb_msg = m; diff --git a/bin/ksh/main.c b/bin/ksh/main.c index 162ef7e136e..4c86593393a 100644 --- a/bin/ksh/main.c +++ b/bin/ksh/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.58 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: main.c,v 1.59 2015/09/17 14:21:33 nicm Exp $ */ /* * startup, main loop, environments and error handling @@ -645,7 +645,7 @@ newenv(int type) { struct env *ep; - ep = (struct env *) alloc(sizeof(*ep), ATEMP); + ep = alloc(sizeof(*ep), ATEMP); ep->type = type; ep->flags = 0; ainit(&ep->area); diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c index cf596221b38..7a38c99558c 100644 --- a/bin/ksh/misc.c +++ b/bin/ksh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.43 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: misc.c,v 1.44 2015/09/17 14:21:33 nicm Exp $ */ /* * Miscellaneous functions @@ -502,7 +502,7 @@ gmatch(const char *s, const char *p, int isfile) int len = pe - p + 1; char tbuf[64]; char *t = len <= sizeof(tbuf) ? tbuf : - (char *) alloc(len, ATEMP); + alloc(len, ATEMP); debunk(t, p, len); return !strcmp(t, s); } @@ -1001,7 +1001,7 @@ void print_columns(struct shf *shf, int n, char *(*func) (void *, int, char *, int), void *arg, int max_width, int prefcol) { - char *str = (char *) alloc(max_width + 1, ATEMP); + char *str = alloc(max_width + 1, ATEMP); int i; int r, c; int rows, cols; diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c index f7d3f4940ce..6c4bbb2423a 100644 --- a/bin/ksh/shf.c +++ b/bin/ksh/shf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shf.c,v 1.20 2015/09/15 20:59:05 nicm Exp $ */ +/* $OpenBSD: shf.c,v 1.21 2015/09/17 14:21:33 nicm Exp $ */ /* * Shell file I/O routines @@ -33,7 +33,7 @@ shf_open(const char *name, int oflags, int mode, int sflags) int fd; /* Done before open so if alloca fails, fd won't be lost. */ - shf = (struct shf *) alloc(sizeof(struct shf) + bsize, ATEMP); + shf = alloc(sizeof(struct shf) + bsize, ATEMP); shf->areap = ATEMP; shf->buf = (unsigned char *) &shf[1]; shf->bsize = bsize; @@ -96,12 +96,12 @@ shf_fdopen(int fd, int sflags, struct shf *shf) if (shf) { if (bsize) { - shf->buf = (unsigned char *) alloc(bsize, ATEMP); + shf->buf = alloc(bsize, ATEMP); sflags |= SHF_ALLOCB; } else shf->buf = (unsigned char *) 0; } else { - shf = (struct shf *) alloc(sizeof(struct shf) + bsize, ATEMP); + shf = alloc(sizeof(struct shf) + bsize, ATEMP); shf->buf = (unsigned char *) &shf[1]; sflags |= SHF_ALLOCS; } @@ -184,7 +184,7 @@ shf_sopen(char *buf, int bsize, int sflags, struct shf *shf) internal_errorf(1, "shf_sopen: flags 0x%x", sflags); if (!shf) { - shf = (struct shf *) alloc(sizeof(struct shf), ATEMP); + shf = alloc(sizeof(struct shf), ATEMP); sflags |= SHF_ALLOCS; } shf->areap = ATEMP; diff --git a/bin/ksh/syn.c b/bin/ksh/syn.c index 88fa2ce22b1..544a1e8ba64 100644 --- a/bin/ksh/syn.c +++ b/bin/ksh/syn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syn.c,v 1.31 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: syn.c,v 1.32 2015/09/17 14:21:33 nicm Exp $ */ /* * shell parser (C version) @@ -197,7 +197,7 @@ get_command(int cf) XPtrV args, vars; struct nesting_state old_nesting; - iops = (struct ioword **) alloc(sizeofN(struct ioword *, NUFILE+1), + iops = alloc(sizeofN(struct ioword *, NUFILE+1), ATEMP); XPinit(args, 16); XPinit(vars, 16); @@ -565,13 +565,13 @@ function_body(char *name, * be used as input), we pretend there is a colon here. */ t->left = newtp(TCOM); - t->left->args = (char **) alloc(sizeof(char *) * 2, ATEMP); + t->left->args = alloc(sizeof(char *) * 2, ATEMP); t->left->args[0] = alloc(sizeof(char) * 3, ATEMP); t->left->args[0][0] = CHAR; t->left->args[0][1] = ':'; t->left->args[0][2] = EOS; t->left->args[1] = NULL; - t->left->vars = (char **) alloc(sizeof(char *), ATEMP); + t->left->vars = alloc(sizeof(char *), ATEMP); t->left->vars[0] = NULL; t->left->lineno = 1; } @@ -743,7 +743,7 @@ newtp(int type) { struct op *t; - t = (struct op *) alloc(sizeof(*t), ATEMP); + t = alloc(sizeof(*t), ATEMP); t->type = type; t->u.evalflags = 0; t->args = t->vars = NULL; diff --git a/bin/ksh/table.c b/bin/ksh/table.c index 497cf405864..07192f68f17 100644 --- a/bin/ksh/table.c +++ b/bin/ksh/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.16 2015/09/01 13:12:31 tedu Exp $ */ +/* $OpenBSD: table.c,v 1.17 2015/09/17 14:21:33 nicm Exp $ */ /* * dynamic hashed associative table for commands and variables @@ -40,7 +40,7 @@ texpand(struct table *tp, int nsize) struct tbl **ntblp, **otblp = tp->tbls; int osize = tp->size; - ntblp = (struct tbl**) alloc(sizeofN(struct tbl *, nsize), tp->areap); + ntblp = alloc(sizeofN(struct tbl *, nsize), tp->areap); for (i = 0; i < nsize; i++) ntblp[i] = NULL; tp->size = nsize; @@ -117,7 +117,7 @@ ktenter(struct table *tp, const char *n, unsigned int h) /* create new tbl entry */ len = strlen(n) + 1; - p = (struct tbl *) alloc(offsetof(struct tbl, name[0]) + len, + p = alloc(offsetof(struct tbl, name[0]) + len, tp->areap); p->flag = 0; p->type = 0; @@ -170,7 +170,7 @@ ktsort(struct table *tp) int i; struct tbl **p, **sp, **dp; - p = (struct tbl **)alloc(sizeofN(struct tbl *, tp->size+1), ATEMP); + p = alloc(sizeofN(struct tbl *, tp->size+1), ATEMP); sp = tp->tbls; /* source */ dp = p; /* dest */ for (i = 0; i < tp->size; i++) diff --git a/bin/ksh/tree.c b/bin/ksh/tree.c index 4d6cedb1ab9..b87f14b9b8b 100644 --- a/bin/ksh/tree.c +++ b/bin/ksh/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.22 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: tree.c,v 1.23 2015/09/17 14:21:33 nicm Exp $ */ /* * command tree climbing @@ -457,7 +457,7 @@ tcopy(struct op *t, Area *ap) if (t == NULL) return NULL; - r = (struct op *) alloc(sizeof(struct op), ap); + r = alloc(sizeof(struct op), ap); r->type = t->type; r->u.evalflags = t->u.evalflags; @@ -469,8 +469,7 @@ tcopy(struct op *t, Area *ap) else { for (tw = t->vars; *tw++ != NULL; ) ; - rw = r->vars = (char **) - alloc((tw - t->vars + 1) * sizeof(*tw), ap); + rw = r->vars = alloc((tw - t->vars + 1) * sizeof(*tw), ap); for (tw = t->vars; *tw != NULL; ) *rw++ = wdcopy(*tw++, ap); *rw = NULL; @@ -481,8 +480,7 @@ tcopy(struct op *t, Area *ap) else { for (tw = t->args; *tw++ != NULL; ) ; - rw = r->args = (char **) - alloc((tw - t->args + 1) * sizeof(*tw), ap); + rw = r->args = alloc((tw - t->args + 1) * sizeof(*tw), ap); for (tw = t->args; *tw != NULL; ) *rw++ = wdcopy(*tw++, ap); *rw = NULL; @@ -632,13 +630,13 @@ iocopy(struct ioword **iow, Area *ap) for (ior = iow; *ior++ != NULL; ) ; - ior = (struct ioword **) alloc((ior - iow + 1) * sizeof(*ior), ap); + ior = alloc((ior - iow + 1) * sizeof(*ior), ap); for (i = 0; iow[i] != NULL; i++) { struct ioword *p, *q; p = iow[i]; - q = (struct ioword *) alloc(sizeof(*p), ap); + q = alloc(sizeof(*p), ap); ior[i] = q; *q = *p; if (p->name != NULL) diff --git a/bin/ksh/var.c b/bin/ksh/var.c index 4601feebbcf..c23a3130af5 100644 --- a/bin/ksh/var.c +++ b/bin/ksh/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.47 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: var.c,v 1.48 2015/09/17 14:21:33 nicm Exp $ */ #include "sh.h" #include <time.h> @@ -35,7 +35,7 @@ newblock(void) struct block *l; static char *const empty[] = {null}; - l = (struct block *) alloc(sizeof(struct block), ATEMP); + l = alloc(sizeof(struct block), ATEMP); l->flags = 0; ainit(&l->area); /* todo: could use e->area (l->area => l->areap) */ if (!e->loc) { @@ -512,7 +512,7 @@ formatstr(struct tbl *vp, const char *s) } else nlen = olen; - p = (char *) alloc(nlen + 1, ATEMP); + p = alloc(nlen + 1, ATEMP); if (vp->flag & (RJUST|LJUST)) { int slen; @@ -568,7 +568,7 @@ export(struct tbl *vp, const char *val) int vallen = strlen(val) + 1; vp->flag |= ALLOC; - xp = (char*)alloc(namelen + 1 + vallen, vp->areap); + xp = alloc(namelen + 1 + vallen, vp->areap); memcpy(vp->val.s = xp, vp->name, namelen); xp += namelen; *xp++ = '='; @@ -1123,7 +1123,7 @@ arraysearch(struct tbl *vp, int val) else new = curr; } else - new = (struct tbl *)alloc(sizeof(struct tbl) + namelen, + new = alloc(sizeof(struct tbl) + namelen, vp->areap); strlcpy(new->name, vp->name, namelen); new->flag = vp->flag & ~(ALLOC|DEFINED|ISSET|SPECIAL); diff --git a/bin/ksh/vi.c b/bin/ksh/vi.c index 21ca661c26c..c24fd043fdb 100644 --- a/bin/ksh/vi.c +++ b/bin/ksh/vi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vi.c,v 1.31 2015/09/15 18:15:05 tedu Exp $ */ +/* $OpenBSD: vi.c,v 1.32 2015/09/17 14:21:33 nicm Exp $ */ /* * vi command editing @@ -1377,7 +1377,7 @@ save_edstate(struct edstate *old) { struct edstate *new; - new = (struct edstate *)alloc(sizeof(struct edstate), APERM); + new = alloc(sizeof(struct edstate), APERM); new->cbuf = alloc(old->cbufsize, APERM); memcpy(new->cbuf, old->cbuf, old->linelen); new->cbufsize = old->cbufsize; |