jasper 2114697ef0 update radmind to 1.9.0
from William Yodlowsky (MAINTAINER)
2007-09-04 20:52:13 +00:00

70 lines
2.5 KiB
Plaintext

$OpenBSD: patch-lmerge_c,v 1.2 2007/09/04 20:52:13 jasper Exp $
--- lmerge.c.orig Tue Feb 7 12:22:17 2006
+++ lmerge.c Sun Mar 18 12:15:14 2007
@@ -48,7 +48,7 @@ create_node( char *path )
fprintf( stderr, "%s: path too long\n", path );
return( NULL );
}
- strcpy( new_node->path, path );
+ (void)strlcpy( new_node->path, path, sizeof( new_node->path ) );
return( new_node );
}
@@ -144,7 +144,7 @@ getline:
tran->t_tran_name, tran->t_linenum, d_path );
return( 1 );
}
- strcpy( tran->t_filepath, d_path );
+ (void)strlcpy( tran->t_filepath, d_path, sizeof( tran->t_filepath ) );
/* Check transcript order */
if ( tran->t_prepath != 0 ) {
@@ -161,7 +161,7 @@ getline:
tran->t_tran_name, tran->t_linenum, tran->t_filepath );
return( 1 );
}
- strcpy( tran->t_prepath, tran->t_filepath );
+ (void)strlcpy( tran->t_prepath, tran->t_filepath, sizeof( tran->t_prepath ) );
return( 0 );
@@ -316,17 +316,17 @@ main( int argc, char **argv )
fprintf( stderr, "%s: path too long\n", trans[ 1 ]->t_file_root );
exit( 2 );
}
- strcpy( file_root, trans[ 1 ]->t_file_root );
+ (void)strlcpy( file_root, trans[ 1 ]->t_file_root, sizeof( file_root ) );
if ( strlen( trans[ 1 ]->t_tran_root ) >= MAXPATHLEN ) {
fprintf( stderr, "%s: path too long\n", trans[ 1 ]->t_tran_root );
exit( 2 );
}
- strcpy( tran_root, trans[ 1 ]->t_tran_root );
+ (void)strlcpy( tran_root, trans[ 1 ]->t_tran_root, sizeof( tran_root ) );
if ( strlen( trans[ 1 ]->t_tran_name ) >= MAXPATHLEN ) {
fprintf( stderr, "%s: path too long\n", trans[ 1 ]->t_tran_name );
exit( 2 );
}
- strcpy( tran_name, trans[ 1 ]->t_tran_name );
+ (void)strlcpy( tran_name, trans[ 1 ]->t_tran_name, sizeof( tran_name ) );
} else {
/* Create tran if missing */
if (( ofd = open( argv[ argc - 1 ], O_WRONLY | O_CREAT, 0666 ) ) < 0 ) {
@@ -344,7 +344,7 @@ main( int argc, char **argv )
fprintf( stderr, "%s: path too long\n", argv[ argc - 1 ] );
exit( 2 );
}
- strcpy( cwd, argv[ argc - 1 ] );
+ (void)strlcpy( cwd, argv[ argc - 1 ], sizeof( cwd ) );
} else {
if ( snprintf( temp, MAXPATHLEN, "%s/%s", cwd, argv[ argc - 1 ] )
> MAXPATHLEN - 1 ) {
@@ -352,7 +352,7 @@ main( int argc, char **argv )
argv[ argc - 1 ] );
exit( 2 );
}
- strcpy( cwd, temp );
+ (void)strlcpy( cwd, temp, sizeof( cwd ) );
}
if ( get_root( radmind_path, cwd, file_root, tran_root, tran_name ) != 0 ) {
exit( 2 );