Deleted Added
full compact
apps.c (68651) apps.c (100936)
1/* apps/apps.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 214 unchanged lines hidden (view full) ---

223 q=strrchr(p,*chars);
224 if (q > p)
225 p = q + 1;
226 chars++;
227 }
228
229 q=strrchr(p,'.');
230 if (q == NULL)
1/* apps/apps.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 214 unchanged lines hidden (view full) ---

223 q=strrchr(p,*chars);
224 if (q > p)
225 p = q + 1;
226 chars++;
227 }
228
229 q=strrchr(p,'.');
230 if (q == NULL)
231 q = in+size;
232 strncpy(out,p,q-p);
233 out[q-p]='\0';
231 q = p + strlen(p);
232 strncpy(out,p,size-1);
233 if (q-p >= size)
234 {
235 out[size-1]='\0';
236 }
237 else
238 {
239 out[q-p]='\0';
240 }
234 }
235#else
236void program_name(char *in, char *out, int size)
237 {
238 char *p;
239
240 p=strrchr(in,'/');
241 if (p != NULL)

--- 508 unchanged lines hidden (view full) ---

750 return 1;
751 }
752 }
753 return 0;
754}
755
756void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
757{
241 }
242#else
243void program_name(char *in, char *out, int size)
244 {
245 char *p;
246
247 p=strrchr(in,'/');
248 if (p != NULL)

--- 508 unchanged lines hidden (view full) ---

757 return 1;
758 }
759 }
760 return 0;
761}
762
763void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
764{
758 char buf[256];
765 char *buf;
759 char mline = 0;
760 int indent = 0;
761 if(title) BIO_puts(out, title);
762 if((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
763 mline = 1;
764 indent = 4;
765 }
766 if(lflags == XN_FLAG_COMPAT) {
766 char mline = 0;
767 int indent = 0;
768 if(title) BIO_puts(out, title);
769 if((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
770 mline = 1;
771 indent = 4;
772 }
773 if(lflags == XN_FLAG_COMPAT) {
767 X509_NAME_oneline(nm,buf,256);
768 BIO_puts(out,buf);
774 buf = X509_NAME_oneline(nm, 0, 0);
775 BIO_puts(out, buf);
769 BIO_puts(out, "\n");
776 BIO_puts(out, "\n");
777 OPENSSL_free(buf);
770 } else {
771 if(mline) BIO_puts(out, "\n");
772 X509_NAME_print_ex(out, nm, indent, lflags);
773 BIO_puts(out, "\n");
774 }
775}
776
778 } else {
779 if(mline) BIO_puts(out, "\n");
780 X509_NAME_print_ex(out, nm, indent, lflags);
781 BIO_puts(out, "\n");
782 }
783}
784