CVS commit: src/usr.bin/btkey

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:52:26 UTC 2021

Modified Files:
src/usr.bin/btkey: btkey.c

Log Message:
btkey: fix lint warning about wrong call to tolower


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/btkey/btkey.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/btkey/btkey.c
diff -u src/usr.bin/btkey/btkey.c:1.4 src/usr.bin/btkey/btkey.c:1.5
--- src/usr.bin/btkey/btkey.c:1.4	Mon Aug 29 14:24:03 2011
+++ src/usr.bin/btkey/btkey.c	Wed Aug 25 22:52:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: btkey.c,v 1.4 2011/08/29 14:24:03 joerg Exp $	*/
+/*	$NetBSD: btkey.c,v 1.5 2021/08/25 22:52:25 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2007 Iain Hibbert
@@ -29,7 +29,7 @@
 
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2007 Iain Hibbert.  All rights reserved.");
-__RCSID("$NetBSD: btkey.c,v 1.4 2011/08/29 14:24:03 joerg Exp $");
+__RCSID("$NetBSD: btkey.c,v 1.5 2021/08/25 22:52:25 rillig Exp $");
 
 #include 
 #include 
@@ -254,7 +254,9 @@ scan_key(const char *arg)
 			if (*arg == '\0')
 return true;
 
-			for (p = digits ; *p != tolower((int)*arg) ; p++)
+			for (p = digits ;
+			*p != tolower((unsigned char)*arg) ;
+			p++)
 if (*p == '\0')
 	return false;
 



CVS commit: src/usr.bin/btkey

2021-08-25 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Aug 25 22:52:26 UTC 2021

Modified Files:
src/usr.bin/btkey: btkey.c

Log Message:
btkey: fix lint warning about wrong call to tolower


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/btkey/btkey.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/btkey

2020-06-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jun  7 00:15:37 UTC 2020

Modified Files:
src/usr.bin/btkey: file.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/btkey/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/btkey/file.c
diff -u src/usr.bin/btkey/file.c:1.2 src/usr.bin/btkey/file.c:1.3
--- src/usr.bin/btkey/file.c:1.2	Sun Feb 23 07:50:01 2014
+++ src/usr.bin/btkey/file.c	Sun Jun  7 00:15:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.2 2014/02/23 07:50:01 mlelstv Exp $	*/
+/*	$NetBSD: file.c,v 1.3 2020/06/07 00:15:37 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2007 Iain Hibbert
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: file.c,v 1.2 2014/02/23 07:50:01 mlelstv Exp $");
+__RCSID("$NetBSD: file.c,v 1.3 2020/06/07 00:15:37 thorpej Exp $");
 
 #include 
 #include 
@@ -67,7 +67,7 @@ list_file(void)
 		goto done;
 
 	while ((sym = prop_object_iterator_next(iter)) != NULL) {
-		if (bt_aton(prop_dictionary_keysym_cstring_nocopy(sym), ) == 0)
+		if (bt_aton(prop_dictionary_keysym_value(sym), ) == 0)
 			continue;
 		if (bdaddr_any())
 			continue;
@@ -78,7 +78,7 @@ list_file(void)
 
 		printf("\n");
 		print_addr("bdaddr", );
-		print_key("file key", prop_data_data_nocopy(dat));
+		print_key("file key", prop_data_value(dat));
 	}
 
 	prop_object_iterator_release(iter);
@@ -111,7 +111,7 @@ read_file(void)
 	if (prop_data_size(dat) != HCI_KEY_SIZE)
 		goto done;
 
-	memcpy(key, prop_data_data_nocopy(dat), HCI_KEY_SIZE);
+	memcpy(key, prop_data_value(dat), HCI_KEY_SIZE);
 	rv = true;
 
 done:
@@ -149,7 +149,7 @@ write_file(void)
 			goto done;
 	}
 
-	dat = prop_data_create_data_nocopy(key, HCI_KEY_SIZE);
+	dat = prop_data_create_nocopy(key, HCI_KEY_SIZE);
 	if (dat == NULL)
 		goto done;
 



CVS commit: src/usr.bin/btkey

2020-06-06 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jun  7 00:15:37 UTC 2020

Modified Files:
src/usr.bin/btkey: file.c

Log Message:
Update for proplib(3) API changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/btkey/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/btkey

2014-02-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Feb 23 07:50:01 UTC 2014

Modified Files:
src/usr.bin/btkey: file.c

Log Message:
skip unparseable addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/btkey/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/btkey/file.c
diff -u src/usr.bin/btkey/file.c:1.1 src/usr.bin/btkey/file.c:1.2
--- src/usr.bin/btkey/file.c:1.1	Fri Nov  9 21:18:25 2007
+++ src/usr.bin/btkey/file.c	Sun Feb 23 07:50:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.1 2007/11/09 21:18:25 plunky Exp $	*/
+/*	$NetBSD: file.c,v 1.2 2014/02/23 07:50:01 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2007 Iain Hibbert
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: file.c,v 1.1 2007/11/09 21:18:25 plunky Exp $);
+__RCSID($NetBSD: file.c,v 1.2 2014/02/23 07:50:01 mlelstv Exp $);
 
 #include sys/stat.h
 #include prop/proplib.h
@@ -67,8 +67,8 @@ list_file(void)
 		goto done;
 
 	while ((sym = prop_object_iterator_next(iter)) != NULL) {
-		memset(bdaddr, 0, sizeof(bdaddr));
-		bt_aton(prop_dictionary_keysym_cstring_nocopy(sym), bdaddr);
+		if (bt_aton(prop_dictionary_keysym_cstring_nocopy(sym), bdaddr) == 0)
+			continue;
 		if (bdaddr_any(bdaddr))
 			continue;
 



CVS commit: src/usr.bin/btkey

2014-02-22 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Feb 23 07:50:01 UTC 2014

Modified Files:
src/usr.bin/btkey: file.c

Log Message:
skip unparseable addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/btkey/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/btkey

2009-05-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon May 18 12:03:06 UTC 2009

Modified Files:
src/usr.bin/btkey: btkey.1

Log Message:
Sort options. Sort sections. Remove superfluous .Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/btkey/btkey.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/btkey/btkey.1
diff -u src/usr.bin/btkey/btkey.1:1.3 src/usr.bin/btkey/btkey.1:1.4
--- src/usr.bin/btkey/btkey.1:1.3	Tue Mar 10 19:36:33 2009
+++ src/usr.bin/btkey/btkey.1	Mon May 18 12:03:06 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: btkey.1,v 1.3 2009/03/10 19:36:33 joerg Exp $
+.\	$NetBSD: btkey.1,v 1.4 2009/05/18 12:03:06 wiz Exp $
 .\
 .\ Copyright (c) 2007 Iain Hibbert
 .\ All rights reserved.
@@ -33,12 +33,12 @@
 .Nd Bluetooth Link Key management utility
 .Sh SYNOPSIS
 .Nm
-.Op Fl cCrRwW
+.Op Fl CcRrWw
 .Op Fl k Ar key
 .Fl a Ar address
 .Fl d Ar device
 .Nm
-.Fl lL
+.Fl Ll
 .Op Fl d Ar device
 .Sh DESCRIPTION
 The
@@ -76,10 +76,10 @@
 .It Fl a Ar address
 Specify the remote device address.
 May be given as a BDADDR or a name.
-.It Fl c
-Clear key from file.
 .It Fl C
 Clear key from device.
+.It Fl c
+Clear key from file.
 .It Fl d Ar device
 Specify the local device address.
 May be given as a BDADDR or a name.
@@ -87,23 +87,29 @@
 Supply a Link Key as a string of hexadecimal digits.
 Up to 32 digits will be processed and the resulting key
 will be zero padded to 16 octets.
-.It Fl l
-List keys stored in file.
 .It Fl L
 List keys stored in device.
-.It Fl r
-Read key from file.
+.It Fl l
+List keys stored in file.
 .It Fl R
 Read key from device.
-.It Fl w
-Write key to file.
+.It Fl r
+Read key from file.
 .It Fl W
 Write key to device.
+.It Fl w
+Write key to file.
 .El
 .Pp
 Super-user privileges are required to read or write link keys.
+.Sh EXIT STATUS
+.Ex -std
+.Sh FILES
+.Bl -item -compact
+.It
+.Pa /var/db/bthcid.keys
+.El
 .Sh EXAMPLES
-.Pp
 Read key for mouse at ubt0 from file and write to device
 .Pp
 .Dl btkey -d ubt0 -a mouse -rW
@@ -115,14 +121,6 @@
 Clear key for phone at bt3c0 from file and device
 .Pp
 .Dl btkey -d bt3c0 -a phone -cC
-.Pp
-.Sh EXIT STATUS
-.Ex -std
-.Sh FILES
-.Bl -item -compact
-.It
-.Pa /var/db/bthcid.keys
-.El
 .Sh SEE ALSO
 .Xr btpin 1 ,
 .Xr btconfig 8 ,