-/* mcookie.c -- Generates random numbers for xauth
+/*
+ * No copyright is claimed. This code is in the public domain; do with
+ * it what you wish.
+ *
+ * mcookie.c -- Generates random numbers for xauth
* Created: Fri Feb 3 10:42:48 1995 by faith@cs.unc.edu
* Revised: Fri Mar 19 07:48:01 1999 by faith@acm.org
* Public Domain 1995, 1999 Rickard E. Faith (faith@acm.org)
rdsz = wanted - count;
r = read_all(fd, (char *) buf, rdsz);
- if (r < 0)
+ if (r <= 0)
break;
ul_MD5Update(&ctl->ctx, buf, r);
count += r;
fputs(_(" -v, --verbose explain what is being done\n"), out);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(23));
- printf(USAGE_MAN_TAIL("mcookie(1)"));
+ fprintf(out, USAGE_HELP_OPTIONS(23));
+
+ fputs(USAGE_ARGUMENTS, out);
+ fprintf(out, USAGE_ARG_SIZE(_("<num>")));
+
+ fprintf(out, USAGE_MAN_TAIL("mcookie(1)"));
exit(EXIT_SUCCESS);
}
randomness_from_files(&ctl);
free(ctl.files);
- random_get_bytes(&buf, RAND_BYTES);
+ ul_random_get_bytes(&buf, RAND_BYTES);
ul_MD5Update(&ctl.ctx, buf, RAND_BYTES);
if (ctl.verbose)
fprintf(stderr, P_("Got %d byte from %s\n",