X-Git-Url: https://pd.if.org/git/?p=uuid;a=blobdiff_plain;f=t%2Fmd5.c;fp=t%2Fmd5.c;h=50876059597a1ddc5bba3013f496b00e2bfd7ce6;hp=570e613b6f0702a9361917cd87743c31c2168f96;hb=c79f8a942740ec85af61103024b649174913f126;hpb=165a05e98fd4bf5acb97b275c43de2d3d7bbd628 diff --git a/t/md5.c b/t/md5.c index 570e613..5087605 100644 --- a/t/md5.c +++ b/t/md5.c @@ -12,25 +12,6 @@ #include "pduuid.h" #include "ctap.h" -static int strbytes(char *s, unsigned char *d) { - unsigned int byte; - int i = 0; - - if (!s) return 0; - if (*s == 0) return 0; - - while (*s) { - if (*s == '-' || *s == ':') s++; - - if (sscanf(s, "%02x", &byte) != 1) { - return 0; - } - s += 2; - d[i++] = byte & 0xff; - } - return i; -} - void ufmt(pd_uuid_t *uuid, char *s) { int i; for (i=0;i<4;i++) { @@ -65,6 +46,7 @@ int main(int ac, char *av[]) { unsigned char tmp[16]; hash_state md; int i; + int n; static const struct { char *msg; @@ -94,7 +76,9 @@ int main(int ac, char *av[]) { { NULL, { 0 } } }; - plan(7); + for(n=0;tests[n].msg != NULL;n++); + + plan(n); for (i = 0; tests[i].msg != NULL; i++) { md5_init(&md);