8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / krb5 / ss / error.c
blob31c62ffa00c89f131aab0a336ee7150fd61e956f
1 /*
2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 #pragma ident "%Z%%M% %I% %E% SMI"
8 /*
9 * Copyright 1987, 1988, 1989 by MIT Student Information Processing
10 * Board
12 * For copyright information, see copyright.h.
15 #include <stdio.h>
17 #include "copyright.h"
18 #include "com_err.h"
19 #include "ss_internal.h"
21 char * ss_name(sci_idx)
22 int sci_idx;
24 register char *ret_val;
25 register ss_data *infop;
27 infop = ss_info(sci_idx);
28 if (infop->current_request == (char const *)NULL) {
29 ret_val = malloc((unsigned)
30 (strlen(infop->subsystem_name)+1)
31 * sizeof(char));
32 if (ret_val == (char *)NULL)
33 return((char *)NULL);
34 strcpy(ret_val, infop->subsystem_name);
35 return(ret_val);
37 else {
38 register char *cp;
39 register char const *cp1;
40 ret_val = malloc((unsigned)sizeof(char) *
41 (strlen(infop->subsystem_name)+
42 strlen(infop->current_request)+
43 4));
44 cp = ret_val;
45 cp1 = infop->subsystem_name;
46 while (*cp1)
47 *cp++ = *cp1++;
48 *cp++ = ' ';
49 *cp++ = '(';
50 cp1 = infop->current_request;
51 while (*cp1)
52 *cp++ = *cp1++;
53 *cp++ = ')';
54 *cp = '\0';
55 return(ret_val);
59 void ss_error (int sci_idx, long code, const char * fmt, ...)
61 register char *whoami;
62 va_list pvar;
63 va_start (pvar, fmt);
64 whoami = ss_name (sci_idx);
65 com_err_va (whoami, code, fmt, pvar);
66 free (whoami);
67 va_end(pvar);
70 void ss_perror (sci_idx, code, msg) /* for compatibility */
71 int sci_idx;
72 long code;
73 char const *msg;
75 ss_error (sci_idx, code, "%s", msg);