summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-28 17:45:42 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-28 17:45:42 -0700
commitfbc4f5a54be00ef1de26c0d2551c85295663ddfd (patch)
tree3336ad754d21b2cb6f047b9ce46c3062a6566bce
parent2c46444c13ed355f0499530943c8f5f27a60224b (diff)
downloadranpwd.git.old-fbc4f5a54be00ef1de26c0d2551c85295663ddfd.tar.gz
ranpwd.git.old-fbc4f5a54be00ef1de26c0d2551c85295663ddfd.tar.xz
ranpwd.git.old-fbc4f5a54be00ef1de26c0d2551c85295663ddfd.zip
uuid: handle "extending" the uuids slightly more sanely
It's pretty meaningless, but treat a spec for more than one uuid worth of octets as a request for a list of uuids.
-rw-r--r--ranpwd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranpwd.c b/ranpwd.c
index 5fa1cc0..7834b6f 100644
--- a/ranpwd.c
+++ b/ranpwd.c
@@ -323,7 +323,11 @@ static void output_random(enum output_type type, int nchar, int decor)
case ty_uuid:
case ty_uuuid:
getrandom(&ch, 1);
- switch (ichar-nchar) {
+ switch ((ichar-nchar) & 15) {
+ case 0:
+ if (ichar != nchar)
+ putchar(' ');
+ break;
case 4:
case 10:
putchar('-');