summaryrefslogtreecommitdiff
path: root/keyctl.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-02-22 15:39:39 +0000
committerDavid Howells <dhowells@redhat.com>2010-02-22 16:01:39 +0000
commit9be94079efbccd689ae346184c9600cd6fb4aa9e (patch)
tree26f2c111ae71e04412b0ae9d18960ba707d1c4fd /keyctl.c
parent5291796474869579f151f7821410e3ef96d1fa7e (diff)
downloadkeyutils-9be94079efbccd689ae346184c9600cd6fb4aa9e.tar.gz
keyutils historical version 0.3v0.3
- Must invoke initialisation from perror() override in libkeyutils - Minor UI changes - Bump version to permit building in main repositories. - Don't attempt to define the error codes in the header file. - Pass the release ID through to the makefile to affect the shared library name. - Build in the perror() override to get the key error strings displayed. - Need a defattr directive after each files directive.
Diffstat (limited to 'keyctl.c')
-rw-r--r--keyctl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/keyctl.c b/keyctl.c
index f3e54bc..fc28b73 100644
--- a/keyctl.c
+++ b/keyctl.c
@@ -654,11 +654,16 @@ static int act_keyctl_rlist(int argc, char *argv[])
count /= sizeof(key_serial_t);
/* list the keys in the keyring */
- pk = keylist;
- do {
- key = *pk++;
- printf("%d%c", key, count == 1 ? '\n' : ' ');
- } while (--count);
+ if (count <= 0) {
+ printf("\n");
+ }
+ else {
+ pk = keylist;
+ for (; count > 0; count--) {
+ key = *pk++;
+ printf("%d%c", key, count == 1 ? '\n' : ' ');
+ }
+ }
return 0;