Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread ohaya
Hi, I am working on a module, and I get one of the SSL envvars, SSL_CLIENT_CERT, using apr_table_get() into a const char *. The client cert char string returned has the extra beginning line (-BEGIN CERTIFICATE-) and ending line (-END CERTIFICATE-), but I need to remove both of

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread Ben Noordhuis
On Wed, Jun 20, 2012 at 4:35 PM, wrote: > Hi, > > I am working on a module, and I get one of the SSL envvars, SSL_CLIENT_CERT, > using apr_table_get() into a const char *. > > The client cert char string returned has the extra beginning line (-BEGIN > CERTIFICATE-) and ending line (

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread ohaya
Ben Noordhuis wrote: > On Wed, Jun 20, 2012 at 4:35 PM, wrote: > > Hi, > > > > I am working on a module, and I get one of the SSL envvars, > > SSL_CLIENT_CERT, using apr_table_get() into a const char *. > > > > The client cert char string returned has the extra beginning line > > (-

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread Daniel Gruno
On 06/20/2012 05:21 PM, oh...@cox.net wrote: > > Ben Noordhuis wrote: >> On Wed, Jun 20, 2012 at 4:35 PM, wrote: >>> Hi, >>> >>> I am working on a module, and I get one of the SSL envvars, >>> SSL_CLIENT_CERT, using apr_table_get() into a const char *. >>> >>> The client cert char string

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread ohaya
Daniel Gruno wrote: > On 06/20/2012 05:21 PM, oh...@cox.net wrote: > > > > Ben Noordhuis wrote: > >> On Wed, Jun 20, 2012 at 4:35 PM, wrote: > >>> Hi, > >>> > >>> I am working on a module, and I get one of the SSL envvars, > >>> SSL_CLIENT_CERT, using apr_table_get() into a const

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread Daniel Gruno
On 06/20/2012 06:17 PM, oh...@cox.net wrote: > > Hi Ben and Daniel, > > I must be doing wrong. After I added code to strip the begin and end lines, > I get a segfault when I test. > > I notice that the apr_cpystrn() doesn't include a pool parameter, so I guess > it's just moving the char stri

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread ohaya
Daniel Gruno wrote: > On 06/20/2012 06:17 PM, oh...@cox.net wrote: > > > > Hi Ben and Daniel, > > > > I must be doing wrong. After I added code to strip the begin and end > > lines, I get a segfault when I test. > > > > I notice that the apr_cpystrn() doesn't include a pool parameter,

Re: Best (safest) way to edit char string (from envvars)?

2012-06-20 Thread Nick Kew
On 20 Jun 2012, at 15:35, wrote: > The client cert char string returned has the extra beginning line (-BEGIN > CERTIFICATE-) and ending line (-END CERTIFICATE-), but I need to > remove both of those lines for a call that I need to make. That's not quite the same as needing a