[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/src/grep.c
From: |
Charles Levert |
Subject: |
Changes to grep/src/grep.c |
Date: |
Wed, 09 Nov 2005 20:19:04 -0500 |
Index: grep/src/grep.c
diff -u grep/src/grep.c:1.115 grep/src/grep.c:1.116
--- grep/src/grep.c:1.115 Wed Nov 9 02:47:35 2005
+++ grep/src/grep.c Thu Nov 10 01:19:03 2005
@@ -2160,8 +2160,10 @@
else
if (optind < argc)
{
- keys = argv[optind++];
- keycc = strlen (keys);
+ /* A copy must be made in case of an xrealloc() or free() later. */
+ keycc = strlen(argv[optind]);
+ keys = xmalloc(keycc + 1);
+ strcpy(keys, argv[optind++]);
}
else
usage (2);