diff options
author | chuck <chuck@cvs.openbsd.org> | 1996-01-20 00:37:59 +0000 |
---|---|---|
committer | chuck <chuck@cvs.openbsd.org> | 1996-01-20 00:37:59 +0000 |
commit | 804c7befd3754ae69f5ee0ddc11dbe5fc5f5532a (patch) | |
tree | 5a8f8346e995d2029b7ec9f8d9cd58dd15474e7a /usr.sbin/ypserv/yptest/yptest.c | |
parent | fafaacf45195e19fde375c4f1d3489175c273899 (diff) |
fixed string formatting, minor cleanup
Diffstat (limited to 'usr.sbin/ypserv/yptest/yptest.c')
-rw-r--r-- | usr.sbin/ypserv/yptest/yptest.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/usr.sbin/ypserv/yptest/yptest.c b/usr.sbin/ypserv/yptest/yptest.c index 896d0e54159..6cdc6abdd35 100644 --- a/usr.sbin/ypserv/yptest/yptest.c +++ b/usr.sbin/ypserv/yptest/yptest.c @@ -28,7 +28,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: yptest.c,v 1.1 1995/11/01 16:56:40 deraadt Exp $"; +static char rcsid[] = "$Id: yptest.c,v 1.2 1996/01/20 00:37:58 chuck Exp $"; #endif #include <stdio.h> @@ -73,31 +73,23 @@ main() printf("Test 1: yp_match\n"); KeyLen = strlen(Key); Status = yp_match(Domain,Map,Key,KeyLen,&Value,&ValLen); - printf("%*.*s\n",ValLen-1,ValLen-1,Value); - /* yp_match: Value is terminated with LF NUL */ + printf("%*.*s\n",ValLen,ValLen,Value); printf("\nTest 2: yp_first\n"); Status = yp_first(Domain,Map,&Key2,&KeyLen,&Value,&ValLen); - printf("%*.*s %*.*s\n",KeyLen-1,KeyLen-1,Key2,ValLen-1,ValLen-1,Value); - /* yp_first: Value is terminated with LF NUL */ - /* Key2 is terminated with LF NUL */ + printf("%*.*s %*.*s\n",KeyLen,KeyLen,Key2,ValLen,ValLen,Value); printf("\nTest 3: yp_next\n"); - while (Status == 0) { Status = yp_next(Domain,Map,Key2,KeyLen,&Key2,&KeyLen,&Value,&ValLen); if (Status == 0) { - printf("%*.*s %*.*s\n",KeyLen-1,KeyLen-1,Key2,ValLen,ValLen,Value); + printf("%*.*s %*.*s\n",KeyLen,KeyLen,Key2,ValLen,ValLen,Value); } - /* yp_next: Value is terminated with LF NUL */ - /* Key2 is terminated with LF NUL */ } printf("\nTest 4: yp_master\n"); - Status = yp_master(Domain,Map,&Key2); printf("%s\n",Key2); - /* yp_master: Key2 is terminated with NUL */ printf("\nTest 5: yp_order\n"); Status = yp_order(Domain,Map,&Order); @@ -113,7 +105,6 @@ main() y=ypml->ypml_next; } } - printf("\nTest 7: yp_all\n"); Callback.foreach=yptest_foreach; |