summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcsnum.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-12-07 17:10:57 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-12-07 17:10:57 +0000
commit3dd0eeb90cc3cb05b003f511986aa48b242af672 (patch)
tree79eca74f76f32cb4adc73bf57472ab27577ef963 /usr.bin/cvs/rcsnum.c
parent2348195e75220fe47d1af53445293fc2d0b616d4 (diff)
less whitespace, more pretty. ok jfb
Diffstat (limited to 'usr.bin/cvs/rcsnum.c')
-rw-r--r--usr.bin/cvs/rcsnum.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c
index 2992be817e1..16bad8c8727 100644
--- a/usr.bin/cvs/rcsnum.c
+++ b/usr.bin/cvs/rcsnum.c
@@ -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 <jfb@openbsd.org>
- * 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 <sys/param.h>
-
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -42,7 +41,6 @@
*
* Allocate an RCS number structure.
*/
-
RCSNUM*
rcsnum_alloc(void)
{
@@ -79,7 +77,6 @@ rcsnum_free(RCSNUM *rn)
* rcsnum_tostr()
* Returns a pointer to the start of <buf> on success, or NULL on failure.
*/
-
char*
rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen)
{
@@ -91,7 +88,7 @@ rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen)
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 @@ rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen)
* 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 @@ rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth)
* 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 @@ rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth)
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 @@ rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth)
* NULL.
* Returns 0 on success, or -1 on failure.
*/
-
int
rcsnum_aton(const char *str, char **ep, RCSNUM *nump)
{