Commit d6a2af16 authored by David Lawrence's avatar David Lawrence
Browse files

added missing prototype for usage().

wrapped long lines.
removed unused stack variable "byte" from set_bit in dnssec-signzone.
UNUSED(verbose) for yet-to-be-used variable in dnssec-keygen.
argument to return should be in parentheses.
parent d0ad6ddc
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
/* $Id: dnssec-keygen.c,v 1.23 2000/05/19 00:20:39 bwelling Exp $ */
/* $Id: dnssec-keygen.c,v 1.24 2000/05/24 03:16:16 tale Exp $ */
#include <config.h>
......@@ -82,7 +82,7 @@ dsa_size_ok(int size) {
}
static void
usage() {
usage(void) {
printf("Usage:\n");
printf(" %s [options] name\n\n", PROGRAM);
printf("Required options:\n");
......@@ -157,7 +157,8 @@ main(int argc, char **argv) {
rsa_exp = 1;
break;
case 'g':
generator = strtol(isc_commandline_argument, &endp, 10);
generator = strtol(isc_commandline_argument,
&endp, 10);
if (*endp != '\0' || generator <= 0)
fatal("-g requires a positive number");
break;
......@@ -190,6 +191,11 @@ main(int argc, char **argv) {
verbose = strtol(isc_commandline_argument, &endp, 0);
if (*endp != '\0')
fatal("-v must be followed by a number");
/*
* XXXDCL - shut up IRIX. true, this variable
* isn't used yet. but it will be.
*/
UNUSED(verbose);
break;
case 'h':
......@@ -365,7 +371,7 @@ main(int argc, char **argv) {
ret = dst_key_tofile(key, DST_TYPE_PUBLIC | DST_TYPE_PRIVATE);
if (ret != ISC_R_SUCCESS)
fatal("failed to write key %s/%s/%d: %s\n", name,
dst_key_id(key), algtostr(alg), isc_result_totext(ret));
dst_key_id(key), algtostr(alg), isc_result_totext(ret));
isc_buffer_clear(&buf);
ret = dst_key_buildfilename(key, 0, &buf);
......
......@@ -133,7 +133,7 @@ strtotime(char *str, isc_int64_t now, isc_int64_t base) {
}
static void
usage() {
usage(void) {
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\t%s [options] keys\n", PROGRAM);
......
......@@ -107,7 +107,7 @@ algtostr(const dns_secalg_t alg) {
static void
usage() {
usage(void) {
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\t%s [options] keyset keys\n", PROGRAM);
......
......@@ -134,7 +134,9 @@ typetostr(const dns_rdatatype_t type) {
return (char *) r.base;
}
/* Not thread-safe! */
/*
* Not thread-safe!
*/
static char *
algtostr(const dns_secalg_t alg) {
isc_buffer_t b;
......@@ -147,18 +149,17 @@ algtostr(const dns_secalg_t alg) {
check_result(result, "dns_secalg_totext()");
isc_buffer_usedregion(&b, &r);
r.base[r.length] = 0;
return (char *) r.base;
return ((char *)r.base);
}
static inline void
set_bit(unsigned char *array, unsigned int index, unsigned int bit) {
unsigned int byte, shift, mask;
unsigned int shift, mask;
byte = array[index / 8];
shift = 7 - (index % 8);
mask = 1 << shift;
if (bit)
if (bit != 0)
array[index / 8] |= mask;
else
array[index / 8] &= (~mask & 0xFF);
......@@ -1251,7 +1252,7 @@ strtotime(char *str, isc_int64_t now, isc_int64_t base) {
}
static void
usage() {
usage(void) {
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\t%s [options] zonefile [keys]\n", PROGRAM);
......@@ -1261,7 +1262,8 @@ usage() {
fprintf(stderr, "\t-s YYYYMMDDHHMMSS|+offset:\n");
fprintf(stderr, "\t\tSIG start time - absolute|offset (now)\n");
fprintf(stderr, "\t-e YYYYMMDDHHMMSS|+offset|\"now\"+offset]:\n");
fprintf(stderr, "\t\tSIG end time - absolute|from start|from now (now + 30 days)\n");
fprintf(stderr, "\t\tSIG end time - absolute|from start|from now "
"(now + 30 days)\n");
fprintf(stderr, "\t-c ttl:\n");
fprintf(stderr, "\t\tcycle period - regenerate "
"if < cycle from end ( (end-start)/4 )\n");
......@@ -1270,11 +1272,11 @@ usage() {
fprintf(stderr, "\t-o origin:\n");
fprintf(stderr, "\t\tzone origin (name of zonefile)\n");
fprintf(stderr, "\t-f outfile:\n");
fprintf(stderr, "\t\tfile the signed zone is written in " \
"(zonefile + .signed)\n");
fprintf(stderr, "\t\tfile the signed zone is written in "
"(zonefile + .signed)\n");
fprintf(stderr, "\t-a:\n");
fprintf(stderr, "\t\tverify generated signatures "
"(if currently valid)\n");
"(if currently valid)\n");
fprintf(stderr, "\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment