=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/rcsnum.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/cvs/rcsnum.c 2004/07/29 17:47:50 1.3 +++ src/usr.bin/cvs/rcsnum.c 2004/12/07 17:10:56 1.4 @@ -1,16 +1,16 @@ -/* $OpenBSD: rcsnum.c,v 1.3 2004/07/29 17:47:50 jfb Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.4 2004/12/07 17:10:56 tedu Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -21,12 +21,11 @@ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include - #include #include #include @@ -42,7 +41,6 @@ * * Allocate an RCS number structure. */ - RCSNUM* rcsnum_alloc(void) { @@ -79,7 +77,6 @@ * rcsnum_tostr() * Returns a pointer to the start of on success, or NULL on failure. */ - char* rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen) { @@ -91,7 +88,7 @@ return (buf); } - snprintf(buf, blen, "%u", nump->rn_id[0]); + snprintf(buf, blen, "%u", nump->rn_id[0]); for (i = 1; i < nump->rn_len; i++) { snprintf(tmp, sizeof(tmp), ".%u", nump->rn_id[i]); strlcat(buf, tmp, blen); @@ -108,7 +105,6 @@ * numbers deep. * Returns 0 on success, or -1 on failure. */ - int rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth) { @@ -143,7 +139,6 @@ * the result. A value of 0 means that the depth will be the minimum of the * two numbers. */ - int rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth) { @@ -154,7 +149,7 @@ slen = MIN(n1->rn_len, n2->rn_len); if ((depth != 0) && (slen > depth)) slen = depth; - + for (i = 0; i < slen; i++) { res = n1->rn_id[i] - n2->rn_id[i]; if (res < 0) @@ -181,7 +176,6 @@ * NULL. * Returns 0 on success, or -1 on failure. */ - int rcsnum_aton(const char *str, char **ep, RCSNUM *nump) {