openbsd-ports/sysutils/radmind/patches/patch-lmerge_c
pvalchev 82806daf7d Update to radmind-1.4.0
from maintainer William Yodlowsky <bsd@openbsd.rutgers.edu>
2005-01-26 00:33:30 +00:00

70 lines
2.5 KiB
Plaintext

$OpenBSD: patch-lmerge_c,v 1.1 2005/01/26 00:33:30 pvalchev Exp $
--- lmerge.c.orig Thu Jan 20 13:05:15 2005
+++ lmerge.c Thu Jan 20 13:07:16 2005
@@ -47,7 +47,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 );
}
@@ -143,7 +143,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 ) {
@@ -158,7 +158,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 );
@@ -310,17 +310,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 ) {
@@ -338,7 +338,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 ) {
@@ -346,7 +346,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 );