openbsd-ports/net/netatalk/patches/patch-bin_megatron_megatron_c
2007-10-25 18:57:32 +00:00

31 lines
1.1 KiB
Plaintext

$OpenBSD: patch-bin_megatron_megatron_c,v 1.2 2007/10/25 18:57:32 steven Exp $
--- bin/megatron/megatron.c.orig Mon Apr 29 03:52:49 2002
+++ bin/megatron/megatron.c Thu Oct 25 20:30:05 2007
@@ -246,7 +246,7 @@ int megatron( path, module, newname, flags )
*/
if (*newname)
- strcpy(fh.name, newname);
+ strlcpy(fh.name, newname, sizeof(fh.name));
if ( to_open( module, path, &fh, flags ) < 0 ) {
(void)from_close( module );
@@ -302,7 +302,7 @@ int main( argc, argv )
int converts = sizeof(name) / sizeof(char *);
int module = -1;
int flags = 0;
- char *progname, newname[ADEDLEN_NAME + 1];
+ char *progname, newname[ADEDLEN_NAME];
progname = strrchr( argv[ 0 ], '/' );
if (( progname == NULL ) || ( progname == '\0' )) {
@@ -334,7 +334,7 @@ int main( argc, argv )
continue;
}
if ( strcmp( argv [ c ], "--filename" ) == 0 ) {
- if(++c < argc) strncpy(newname,argv[c], ADEDLEN_NAME);
+ if(++c < argc) strlcpy(newname,argv[c], sizeof(newname));
continue;
}
if (strcmp(argv[c], "--stdout") == 0) {