diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 00:18:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 00:18:32 +0000 |
commit | 73166ae1993f107cc8945717f549d2a04c9a975e (patch) | |
tree | bea8ae7c1a82c4be24a8d6be64090656a37f1ba5 /usr.bin/patch | |
parent | d5cf32b9a40c579557415b94415d349322b140b8 (diff) |
strcpy trashing, help from tedu; ok tedu
Diffstat (limited to 'usr.bin/patch')
-rw-r--r-- | usr.bin/patch/pch.c | 6 | ||||
-rw-r--r-- | usr.bin/patch/util.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index 4caf1dfc594..c0c01b8242a 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -1,7 +1,7 @@ -/* $OpenBSD: pch.c,v 1.12 2003/04/05 17:17:53 deraadt Exp $ */ +/* $OpenBSD: pch.c,v 1.13 2003/04/08 00:18:31 deraadt Exp $ */ #ifndef lint -static char rcsid[] = "$OpenBSD: pch.c,v 1.12 2003/04/05 17:17:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pch.c,v 1.13 2003/04/08 00:18:31 deraadt Exp $"; #endif /* not lint */ #include "EXTERN.h" @@ -501,7 +501,7 @@ another_hunk() if (!*s) malformed (); if (strnEQ(s,"0,0",3)) - strcpy(s, s+2); + memmove(s, s+2, strlen(s+2)+1); p_first = (LINENUM) atol(s); while (isdigit(*s)) s++; if (*s == ',') { diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c index 0a68f19deda..5cf7884909d 100644 --- a/usr.bin/patch/util.c +++ b/usr.bin/patch/util.c @@ -1,7 +1,7 @@ -/* $OpenBSD: util.c,v 1.10 2003/04/05 17:17:53 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.11 2003/04/08 00:18:31 deraadt Exp $ */ #ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.10 2003/04/05 17:17:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.11 2003/04/08 00:18:31 deraadt Exp $"; #endif /* not lint */ #include "EXTERN.h" @@ -82,7 +82,7 @@ char *from, *to; if (*s) *s = toupper(*s); else - strcpy(simplename, simplename+1); + memmove(simplename, simplename+1, strlen(simplename+1)+1); } while (unlink(bakname) >= 0) ; /* while() is for benefit of Eunice */ #ifdef DEBUGGING |