summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-04 00:50:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-04 00:50:57 +0000
commit01a6a80c56b9de25cbe0f91a4b37712d07756a00 (patch)
tree98202f649c0855fb8a4b62b64482723f3cf42c99 /lib
parentdfc3a3d1f1bda41172a8654ddc262c53f9d8b4ae (diff)
change sectok_fmt_fid() to accept a size_t for the pathname length;
must crank major, and update utils that use it
Diffstat (limited to 'lib')
-rw-r--r--lib/libsectok/sectok.34
-rw-r--r--lib/libsectok/sectok.c12
-rw-r--r--lib/libsectok/sectok.h4
-rw-r--r--lib/libsectok/shlib_version2
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/libsectok/sectok.3 b/lib/libsectok/sectok.3
index 950fc6ebe97..6ea1820f03c 100644
--- a/lib/libsectok/sectok.3
+++ b/lib/libsectok/sectok.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sectok.3,v 1.6 2003/02/18 07:51:08 jmc Exp $
+.\" $OpenBSD: sectok.3,v 1.7 2003/04/04 00:50:56 deraadt Exp $
.\"
.\" Jim Rees <rees@umich.edu>
.\" CITI Smartcard development <smartcards@umich.edu>
@@ -66,7 +66,7 @@
.Ft int
.Fn sectok_selectfile "int fd" "int cla" "unsigned char *fid" "int *swp"
.Ft void
-.Fn sectok_fmt_fid "char *fname" "unsigned char *fid"
+.Fn sectok_fmt_fid "char *fname" "size_t fnamelen" "unsigned char *fid"
.Ft int
.Fn sectok_parse_atr "int fd" "int flags" "unsigned char *atr" "int len" "struct scparam *param"
.Ft void
diff --git a/lib/libsectok/sectok.c b/lib/libsectok/sectok.c
index 0c545b0ed14..6c2ee92dc06 100644
--- a/lib/libsectok/sectok.c
+++ b/lib/libsectok/sectok.c
@@ -1,4 +1,4 @@
-/* $Id: sectok.c,v 1.11 2003/04/02 22:57:51 deraadt Exp $ */
+/* $Id: sectok.c,v 1.12 2003/04/04 00:50:56 deraadt Exp $ */
/*
copyright 2000
@@ -488,18 +488,18 @@ sectok_apdu(int fd, int cla, int ins, int p1, int p2,
}
void
-sectok_fmt_fid(char *fname, unsigned char *fid)
+sectok_fmt_fid(char *fname, size_t fnamelen, unsigned char *fid)
{
int f0 = fid[0], f1 = fid[1];
if (f0 == 0x3f && f1 == 0)
- sprintf(fname, "/");
+ snprintf(fname, fnamelen, "/");
else if (myisprint(f0) && f1 == 0)
- sprintf(fname, "%c", f0);
+ snprintf(fname, fnamelen, "%c", f0);
else if (myisprint(f0) && myisprint(f1))
- sprintf(fname, "%c%c", f0, f1);
+ snprintf(fname, fnamelen, "%c%c", f0, f1);
else
- sprintf(fname, "%02x%02x", f0, f1);
+ snprintf(fname, fnamelen, "%02x%02x", f0, f1);
}
int
diff --git a/lib/libsectok/sectok.h b/lib/libsectok/sectok.h
index 08d3b3af8db..b96425a8d9d 100644
--- a/lib/libsectok/sectok.h
+++ b/lib/libsectok/sectok.h
@@ -1,4 +1,4 @@
-/* $Id: sectok.h,v 1.15 2001/08/02 15:09:35 rees Exp $ */
+/* $Id: sectok.h,v 1.16 2003/04/04 00:50:56 deraadt Exp $ */
/*
copyright 2001
@@ -80,7 +80,7 @@ int sectok_close(int fd);
int sectok_selectfile(int fd, int cla, unsigned char *fid, int *swp);
/* Convenience functions */
-void sectok_fmt_fid(char *fname, unsigned char *fid);
+void sectok_fmt_fid(char *fname, size_t fnamelen, unsigned char *fid);
int sectok_parse_atr(int fd, int flags, unsigned char *atr, int len, struct scparam *param);
void sectok_parse_fname(char *buf, unsigned char *fid);
int sectok_parse_input(char *ibuf, unsigned char *obuf, int olen);
diff --git a/lib/libsectok/shlib_version b/lib/libsectok/shlib_version
index d9961ea9fef..3066b9771e7 100644
--- a/lib/libsectok/shlib_version
+++ b/lib/libsectok/shlib_version
@@ -1,2 +1,2 @@
-major=4
+major=5
minor=0