Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / libntp / modetoa.c
blob51de4a2354e708e4c397e2c34ba1176616c8b3e1
1 /* $NetBSD$ */
3 /*
4 * modetoa - return an asciized mode
5 */
6 #include <stdio.h>
8 #include "lib_strbuf.h"
9 #include "ntp_stdlib.h"
11 const char *
12 modetoa(
13 int mode
16 char *bp;
17 static const char *modestrings[] = {
18 "unspec",
19 "sym_active",
20 "sym_passive",
21 "client",
22 "server",
23 "broadcast",
24 "control",
25 "private",
26 "bclient",
29 if (mode < 0 || mode >= (sizeof modestrings)/sizeof(char *)) {
30 LIB_GETBUF(bp);
31 (void)sprintf(bp, "mode#%d", mode);
32 return bp;
35 return modestrings[mode];