diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-03-14 05:13:12 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-03-14 05:13:12 +0000 |
commit | 792987ae58d7eb73cd9316b0db73298133aedd0a (patch) | |
tree | df20288853f454d9c1b380583a13a9be108bbabd /lib/libedit/hist.c | |
parent | 2619c4c4532a4d864fb1ca726290a4181e754cc3 (diff) |
fix el_source() - a block needed braces around it (from NetBSD)
Some strcpy() -> strncpy (from NetBSD)
Some KNF
Add current NetBSD tags
Diffstat (limited to 'lib/libedit/hist.c')
-rw-r--r-- | lib/libedit/hist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c index b9a6e20c677..b5deda1fbe2 100644 --- a/lib/libedit/hist.c +++ b/lib/libedit/hist.c @@ -1,4 +1,5 @@ -/* $OpenBSD: hist.c,v 1.2 1997/01/16 05:18:33 millert Exp $ */ +/* $OpenBSD: hist.c,v 1.3 1997/03/14 05:12:48 millert Exp $ */ +/* $NetBSD: hist.c,v 1.2 1997/01/11 06:47:55 lukem Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -40,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: hist.c,v 1.2 1997/01/16 05:18:33 millert Exp $"; +static char rcsid[] = "$OpenBSD: hist.c,v 1.3 1997/03/14 05:12:48 millert Exp $"; #endif #endif /* not lint && not SCCSID */ @@ -106,7 +107,7 @@ hist_get(el) int h; if (el->el_history.eventno == 0) { /* if really the current line */ - (void) strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ - 1); + (void)strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ - 1); el->el_line.buffer[EL_BUFSIZ - 1] = '\0'; el->el_line.lastchar = el->el_line.buffer + (el->el_history.last - el->el_history.buf); @@ -135,7 +136,7 @@ hist_get(el) return CC_ERROR; } - (void) strncpy(el->el_line.buffer, hp, EL_BUFSIZ - 1); + (void)strncpy(el->el_line.buffer, hp, EL_BUFSIZ - 1); el->el_line.buffer[EL_BUFSIZ - 1] = '\0'; el->el_line.lastchar = el->el_line.buffer + strlen(el->el_line.buffer); @@ -173,6 +174,6 @@ hist_list(el, argc, argv) if (el->el_history.ref == NULL) return -1; for (str = HIST_LAST(el); str != NULL; str = HIST_PREV(el)) - (void) fprintf(el->el_outfile, "%d %s", el->el_history.ev->num, str); + (void)fprintf(el->el_outfile, "%d %s", el->el_history.ev->num, str); return 0; } |