diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-04-12 11:34:08 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-04-12 11:34:08 +0000 |
commit | c5ca6fa23eeccbd9c95529a4306dfca703dfddba (patch) | |
tree | 21e7d6522007c502b40ea1cf1f9c0f0bf2751467 | |
parent | 1b6beedd1cda01ac9f27bccd57e20d3963c1e4e0 (diff) | |
download | gnutls-c5ca6fa23eeccbd9c95529a4306dfca703dfddba.tar.gz |
better doc (internal) for _gnutls_int2str()
-rw-r--r-- | lib/gnutls_x509.c | 7 | ||||
-rw-r--r-- | lib/gnutls_x509.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 6a34391f0a..3782cd9e10 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -127,12 +127,13 @@ static int _IREAD(node_asn * rasn, char *name3, int name3_size, char *rstr, char } /* this function will convert up to 3 digit - * numbers to characters. + * numbers to characters. Use a character string of MAX_INT_DIGITS, in + * order to have enough space for it. */ -void _gnutls_int2str(int k, char *data) +void _gnutls_int2str(unsigned int k, char *data) { if (k > 999) - data[0] = 0; + sprintf(data, "%d", 999); else sprintf(data, "%d", k); } diff --git a/lib/gnutls_x509.h b/lib/gnutls_x509.h index 22826d01c9..5e8bba52e8 100644 --- a/lib/gnutls_x509.h +++ b/lib/gnutls_x509.h @@ -2,7 +2,7 @@ int _gnutls_x509_cert_verify_peers(GNUTLS_STATE state); int _gnutls_x509_cert2gnutls_cert(gnutls_cert * gCert, gnutls_datum derCert); #define MAX_INT_DIGITS 4 -void _gnutls_int2str(int k, char *data); +void _gnutls_int2str(unsigned int k, char *data); int _gnutls_check_x509_key_usage( const gnutls_cert * cert, KXAlgorithm alg); time_t gnutls_x509_extract_certificate_activation_time( const gnutls_datum*); |