From 5ece56ae6927c39c1bdcf32820cdca30dfed0786 Mon Sep 17 00:00:00 2001 From: niklas <> Date: Sat, 9 Mar 1996 02:42:58 +0000 Subject: [PATCH] From NetBSD: 960217 merge --- src/lib/libc/string/bcmp.c | 5 ++++- src/lib/libc/string/bm.c | 10 ++++++---- src/lib/libc/string/strcat.c | 6 ++++-- src/lib/libc/string/strcpy.c | 6 ++++-- src/lib/libc/string/strftime.c | 10 ++++++---- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/lib/libc/string/bcmp.c b/src/lib/libc/string/bcmp.c index 2cc38bae..edd83c26 100644 --- a/src/lib/libc/string/bcmp.c +++ b/src/lib/libc/string/bcmp.c @@ -1,3 +1,5 @@ +/* $OpenBSD: bcmp.c,v 1.2 1996/03/09 02:42:54 niklas Exp $ */ + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -33,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)bcmp.c 5.6 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: bcmp.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $"; +static char *rcsid = "$Id: bcmp.c,v 1.2 1996/03/09 02:42:54 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -41,6 +43,7 @@ static char *rcsid = "$Id: bcmp.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $"; /* * bcmp -- vax cmpc3 instruction */ +int bcmp(b1, b2, length) const void *b1, *b2; register size_t length; diff --git a/src/lib/libc/string/bm.c b/src/lib/libc/string/bm.c index 68eac22e..4bc5f178 100644 --- a/src/lib/libc/string/bm.c +++ b/src/lib/libc/string/bm.c @@ -1,3 +1,5 @@ +/* $OpenBSD: bm.c,v 1.2 1996/03/09 02:42:55 niklas Exp $ */ + /*- * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. @@ -34,10 +36,10 @@ * SUCH DAMAGE. */ -#ifndef lint -/* from: static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; */ -static char *rcsid = "$Id: bm.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $"; -#endif /* not lint */ +#if defined(LIBC_SCCS) && !defined(lint) +/* from: static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; */ +static char *rcsid = "$Id: bm.c,v 1.2 1996/03/09 02:42:55 niklas Exp $"; +#endif /* LIBC_SCCS && not lint */ #include diff --git a/src/lib/libc/string/strcat.c b/src/lib/libc/string/strcat.c index e741b84f..10e0aefe 100644 --- a/src/lib/libc/string/strcat.c +++ b/src/lib/libc/string/strcat.c @@ -1,3 +1,5 @@ +/* $OpenBSD: strcat.c,v 1.2 1996/03/09 02:42:56 niklas Exp $ */ + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -33,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strcat.c 5.6 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: strcat.c,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $"; +static char *rcsid = "$Id: strcat.c,v 1.2 1996/03/09 02:42:56 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -46,6 +48,6 @@ strcat(s, append) char *save = s; for (; *s; ++s); - while (*s++ = *append++); + while ((*s++ = *append++) != '\0'); return(save); } diff --git a/src/lib/libc/string/strcpy.c b/src/lib/libc/string/strcpy.c index 669bfde2..86956cdb 100644 --- a/src/lib/libc/string/strcpy.c +++ b/src/lib/libc/string/strcpy.c @@ -1,3 +1,5 @@ +/* $OpenBSD: strcpy.c,v 1.2 1996/03/09 02:42:57 niklas Exp $ */ + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -33,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strcpy.c 5.7 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: strcpy.c,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $"; +static char *rcsid = "$Id: strcpy.c,v 1.2 1996/03/09 02:42:57 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -45,6 +47,6 @@ strcpy(to, from) { char *save = to; - for (; *to = *from; ++from, ++to); + for (; (*to = *from) != '\0'; ++from, ++to); return(save); } diff --git a/src/lib/libc/string/strftime.c b/src/lib/libc/string/strftime.c index b696a60e..0b69e10a 100644 --- a/src/lib/libc/string/strftime.c +++ b/src/lib/libc/string/strftime.c @@ -1,3 +1,5 @@ +/* $OpenBSD: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $ */ + /* * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. @@ -33,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/ -static char *rcsid = "$Id: strftime.c,v 1.2 1995/12/30 08:16:41 deraadt Exp $"; +static char *rcsid = "$Id: strftime.c,v 1.3 1996/03/09 02:42:58 niklas Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -272,7 +274,7 @@ _fmt(format, t) return(gsize); } -static +static int _secs(t) struct tm *t; { @@ -289,7 +291,7 @@ _secs(t) return(_add(++p)); } -static +static int _conv(n, digits, pad) int n, digits; char pad; @@ -304,7 +306,7 @@ _conv(n, digits, pad) return(_add(++p)); } -static +static int _add(str) register char *str; {