aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Traina <pst@FreeBSD.org>1994-11-06 06:27:04 +0000
committerPaul Traina <pst@FreeBSD.org>1994-11-06 06:27:04 +0000
commita0334cef15431cbe851f2140c8a260f9f830325f (patch)
tree637c6b9597a506848a14f037bb109ae9b285b66a
parent2fe6e4d71ea7f0d66df66887364d1a0561b921d3 (diff)
downloadsrc-a0334cef15431cbe851f2140c8a260f9f830325f.tar.gz
src-a0334cef15431cbe851f2140c8a260f9f830325f.zip
Add end of line check so mkinit doesn't produce garbage if you have a
MKINIT line that doesn't have a comment on it (we have at least two). This mkinit program was written by someone who obviously doesn't believe in defensive programming. :-( There's a LOT of work that needs to be done on this thing. :-( :-( :-(
Notes
Notes: svn path=/head/; revision=4204
-rw-r--r--bin/sh/mkinit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/mkinit.c b/bin/sh/mkinit.c
index adc79cc4be28..433bbf7cf99c 100644
--- a/bin/sh/mkinit.c
+++ b/bin/sh/mkinit.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: mkinit.c,v 1.2 1994/09/24 02:57:54 davidg Exp $
*/
#ifndef lint
@@ -352,7 +352,7 @@ dodecl(line1, fp)
if (! amiddecls)
addchar('\n', &decls);
q = NULL;
- for (p = line1 + 6 ; *p != '=' && *p != '/' ; p++);
+ for (p = line1 + 6 ; *p != '=' && *p != '/' && *p != '\n'; p++);
if (*p == '=') { /* eliminate initialization */
for (q = p ; *q && *q != ';' ; q++);
if (*q == '\0')