summaryrefslogtreecommitdiff
path: root/src/fold.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-01-04 21:00:49 +0000
committerJim Meyering <jim@meyering.net>2004-01-04 21:00:49 +0000
commit45c0d30e1d196c6461a3645c698c1553f89b3eb7 (patch)
tree2129952ed057acf14202942d355e0d67f601df77 /src/fold.c
parentebca34437017619df2065ace62d35dc03c6c57eb (diff)
downloadcoreutils-45c0d30e1d196c6461a3645c698c1553f89b3eb7.tar.xz
(main): Use memcpy, not strcpy.
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fold.c b/src/fold.c
index 5d3b3d897..6f50f02b6 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -1,5 +1,5 @@
/* fold -- wrap each input line to fit in specified width.
- Copyright (C) 91, 1995-2003 Free Software Foundation, Inc.
+ Copyright (C) 91, 1995-2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -263,10 +263,11 @@ main (int argc, char **argv)
break;
if (ISDIGIT (a[1]))
{
- char *s = xmalloc (strlen (a) + 2);
+ size_t len_a = strlen (a);
+ char *s = xmalloc (len_a + 2);
s[0] = '-';
s[1] = 'w';
- strcpy (s + 2, a + 1);
+ memcpy (s + 2, a + 1, len_a);
argv[i] = s;
if (200112 <= posix2_version ())
{