l = p - s - c;
filename = calloc( sizeof( char ), l + 1 );
- strncpy( filename, s + c, l );
+ AC_MEMCPY( filename, s + c, l );
filename[ l ] = '\0';
map->lm_args = ( void * )fopen( filename, "r" );
*/
l = p - s - c;
url = calloc( sizeof( char ), l + 3 );
- strncpy( url, s + c, l );
+ AC_MEMCPY( url, s + c, l );
url[ l ] = '\0';
/*
*/
l = p - string - 1;
s = calloc( sizeof( char ), l + 1 );
- strncpy( s, string, l );
+ AC_MEMCPY( s, string, l );
s[ l ] = 0;
/*
if ( subs[ nsub - 1 ]->bv_val == NULL ) {
return NULL;
}
- strncpy( subs[ nsub - 1 ]->bv_val, begin, l );
+ AC_MEMCPY( subs[ nsub - 1 ]->bv_val, begin, l );
subs[ nsub - 1 ]->bv_val[ l ] = '\0';
} else {
subs[ nsub - 1 ] = NULL;
subs_len += l;
subs[ nsub ]->bv_len = l;
subs[ nsub ]->bv_val = malloc( l + 1 );
- strncpy( subs[ nsub ]->bv_val, begin, l );
+ AC_MEMCPY( subs[ nsub ]->bv_val, begin, l );
subs[ nsub ]->bv_val[ l ] = '\0';
} else {
subs[ nsub ] = NULL;
return REWRITE_ERR;
}
- strncpy( val->bv_val, s, l );
+ AC_MEMCPY( val->bv_val, s, l );
val->bv_val[ l ] = '\0';
return REWRITE_SUCCESS;
*/
for ( n = 0, cl = 0; n < subst->lt_num_submatch; n++ ) {
if ( subst->lt_subs[ n ] != NULL ) {
- strcpy( res + cl, subst->lt_subs[ n ]->bv_val);
+ AC_MEMCPY( res + cl, subst->lt_subs[ n ]->bv_val,
+ subst->lt_subs[ n ]->bv_len );
cl += subst->lt_subs[ n ]->bv_len;
}
- strcpy( res + cl, submatch[ n ].bv_val );
+ AC_MEMCPY( res + cl, submatch[ n ].bv_val,
+ submatch[ n ].bv_len );
cl += submatch[ n ].bv_len;
free( submatch[ n ].bv_val );
}
if ( subst->lt_subs[ n ] != NULL ) {
- strcpy( res + cl, subst->lt_subs[ n ]->bv_val );
+ AC_MEMCPY( res + cl, subst->lt_subs[ n ]->bv_val,
+ subst->lt_subs[ n ]->bv_len );
}
val->bv_val = res;