From 3d246063e563c9c00a31ab2b3b89695ea6ca905f Mon Sep 17 00:00:00 2001 From: barant Date: Mon, 23 Dec 2024 11:16:15 -0800 Subject: [PATCH] cleanup for valgrind. --- Tag.h | 4 ++-- __call.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Tag.h b/Tag.h index 07d1254..ab992a4 100644 --- a/Tag.h +++ b/Tag.h @@ -23,8 +23,8 @@ namespace jet { Tag *local; protected: - bool hasContainer; - bool hasContainer2; + bool hasContainer = false; + bool hasContainer2 = false; bool variableDefined(coreutils::ZString variable); void parseContainer(coreutils::ZString &in, coreutils::MString &out); void processContainer(coreutils::ZString &container); diff --git a/__call.cpp b/__call.cpp index 83fa037..ecf8784 100644 --- a/__call.cpp +++ b/__call.cpp @@ -15,7 +15,9 @@ namespace jet { if(!variableDefined("pgm")) throw coreutils::Exception("pgm keyword must be specified."); resolveKeyword("pgm"); - argv[0] = variables["pgm"].c_str(); // TODO: Need to peel off the program name only and pass as argv[0]. + for(ix = 0; ix <= 50; ++ix) + argv[ix] = NULL; + argv[0] = variables["pgm"].c_str(); // TODO: Need to peel off the program name only and pass as argv[0]. for(ix = 1; ix <= 50; ++ix) { coreutils::MString arg("arg"); arg << ix; @@ -25,7 +27,6 @@ namespace jet { } else break; } - argv[ix] == NULL; pipe(fdo); pid = fork(); if(pid == 0) {