Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7022)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7023)
@@ -57,4 +57,21 @@
    * star.rc:
      - added setup strings for software trigger
+
+   * mbase/MContinue.cc:
+     - allow setup of already set filters in ReadEnv. They must not
+       necessarily be already in the tasklist
+
+   * mcalib/MCalibrationChargeCalc.cc:
+     - shortened a lot of Form() calls to reduce the risk of
+       memory corruption
+
+   * mjobs/MJCalibration.cc:
+     - some cosmetics to text in pad
+
+   * mraw/MRawRunHeader.[h,cc]:
+     - a fix to MRawRunHeader because the definition of the
+       raw-data format has changed. fProjectName and fSourceName
+       has no trailig \0 anymore by default
+     - incremented ClassVersion by 1
 
 
Index: /trunk/MagicSoft/Mars/mbase/MContinue.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 7022)
+++ /trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 7023)
@@ -260,5 +260,5 @@
 Int_t MContinue::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
 {
-    MFilter *f = 0;
+    MFilter *f = MTask::GetFilter();
     if (IsEnvDefined(env, prefix, "Condition", print))
     {
@@ -276,4 +276,5 @@
     if (!f)
         f = new MF;
+
     f->SetName(fName);
 
@@ -281,12 +282,15 @@
     if (rc!=kTRUE)
     {
-        delete f;
+        if (f!=MTask::GetFilter())
+            delete f;
         return rc;
     }
 
-    if (TestBit(kIsOwner))
-        delete GetFilter();
-
-    SetBit(kIsOwner);
+    if (f != MTask::GetFilter())
+    {
+        if (TestBit(kIsOwner))
+            delete GetFilter();
+        SetBit(kIsOwner);
+    }
     MTask::SetFilter(f);
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7022)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7023)
@@ -984,7 +984,8 @@
   if (cal.GetSigma() < cal.GetPedRms())
     {
-      *fLog << warn
-            << Form("Sigma of Fitted Charge: %6.2f <",cal.GetSigma())
-	    << Form(" Ped. RMS=%5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
+      *fLog << warn << "Sigma of Fitted Charge: "
+            << Form("%6.2f <",cal.GetSigma()) << " Ped. RMS="
+            << Form("%5.2f", cal.GetPedRms()) << " in " << what
+	    << Form("%3i",cal.GetPixId()) << endl;
       bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
       return kFALSE;
@@ -993,7 +994,6 @@
   if (!cal.CalcReducedSigma())
     {
-      *fLog << warn 
-            << Form("Could not calculate the reduced sigma in %s:               ",what)
-            << Form("         %4i",cal.GetPixId()) 
+      *fLog << warn << "Could not calculate the reduced sigma in " << what
+            << ":                        " << Form("%4i",cal.GetPixId())
             << endl;
       bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
@@ -1003,7 +1003,6 @@
   if (!cal.CalcFFactor())
     {
-      *fLog << warn 
-            << Form("Could not calculate the F-Factor in %s:                    ",what)
-            << Form("         %4i",cal.GetPixId()) 
+      *fLog << warn << "Could not calculate the F-Factor in " << what
+            << ":                             " << Form("%4i",cal.GetPixId())
             << endl;
       bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
@@ -1021,7 +1020,6 @@
   if (!cal.CalcConvFFactor())
     {
-      *fLog << warn 
-            << Form("Could not calculate the Conv. FADC counts to Phes in %s:  ",what)
-            << Form("         %4i",cal.GetPixId()) 
+      *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in "
+            << what << ":           " << Form("%4i",cal.GetPixId())
             << endl;
       bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7022)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 7023)
@@ -863,41 +863,41 @@
       t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol + 1.)));
       t1->SetTextAlign(12);
-      TText *t2 = pave->AddText(Form("%s%3i%s","Signal Rel. error too large:                          ",
+      TText *t2 = pave->AddText(Form("%s%3i%s","Signal Rel. error too large:                            ",
                                        CountBadPixels(&disp24,2)," pixels"));
       t2->SetTextColor(gStyle->GetColorPalette(Int_t(2./max*numcol + 1.)));
       t2->SetTextAlign(12);
-      TText *t4 = pave->AddText(Form("Low Gain Saturation:                                   %3i pixels",
+      TText *t4 = pave->AddText(Form("Low Gain Saturation:                                     %3i pixels",
                                        CountBadPixels(&disp24,3)));
       t4->SetTextColor(gStyle->GetColorPalette(Int_t(3./max*numcol + 1.)));
       t4->SetTextAlign(12);
-      TText *t5 = pave->AddText(Form("Mean Arr. Time In First Extraction Bin:      %3i pixels",
+      TText *t5 = pave->AddText(Form("Mean Arr. Time In First Extraction Bin:        %3i pixels",
                                        CountBadPixels(&disp24,4)));
       t5->SetTextColor(gStyle->GetColorPalette(Int_t(4./max*numcol + 1.)));
       t5->SetTextAlign(12);
-      TText *t6 = pave->AddText(Form("Mean Arr. Time In Last 2 Extraction Bins: %3i pixels",
+      TText *t6 = pave->AddText(Form("Mean Arr. Time In Last 2 Extraction Bins:   %3i pixels",
                                        CountBadPixels(&disp24,5)));
       t6->SetTextColor(gStyle->GetColorPalette(Int_t(5./max*numcol + 1.)));
       t6->SetTextAlign(12);
-      TText *t9 = pave->AddText(Form("Deviating Number of Photons:                    %3i pixels",
+      TText *t9 = pave->AddText(Form("Deviating Number of Photons:                      %3i pixels",
                                        CountBadPixels(&disp24,6)));
       t9->SetTextColor(gStyle->GetColorPalette(Int_t(6./max*numcol + 1.)));
       t9->SetTextAlign(12);
-      TText *t10= pave->AddText(Form("High-Gain Histogram Overflow:                  %3i pixels",
+      TText *t10= pave->AddText(Form("High-Gain Histogram Overflow:                    %3i pixels",
                                        CountBadPixels(&disp24,7 )));
       t10->SetTextColor(gStyle->GetColorPalette(Int_t(7./max*numcol + 1.)));
       t10->SetTextAlign(12);
-      TText *t11= pave->AddText(Form("Low-Gain Histogram Overflow:                   %3i pixels",
+      TText *t11= pave->AddText(Form("Low-Gain Histogram Overflow:                     %3i pixels",
                                        CountBadPixels(&disp24,8 )));
       t11->SetTextColor(gStyle->GetColorPalette(Int_t(8./max*numcol + 1.)));
       t11->SetTextAlign(12);
-      TText *t12= pave->AddText(Form("Presumably dead from Ped. Rms:              %3i pixels",
+      TText *t12= pave->AddText(Form("Presumably dead from Ped. Rms:                %3i pixels",
                                        CountBadPixels(&disp24,9 )));
       t12->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol + 1.)));
       t12->SetTextAlign(12);
-      TText *t13= pave->AddText(Form("Fluctuating Pulse Arrival Times:                 %3i pixels",
+      TText *t13= pave->AddText(Form("Fluctuating Pulse Arrival Times:                   %3i pixels",
                                        CountBadPixels(&disp24,10)));
       t13->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol + 1.)));
       t13->SetTextAlign(12);
-      TText *t14= pave->AddText(Form("Previously Excluded:                                   %3i pixels",
+      TText *t14= pave->AddText(Form("Previously Excluded:                                     %3i pixels",
                                        CountBadPixels(&disp24,11)));
       t14->SetTextColor(gStyle->GetColorPalette(Int_t(11./max*numcol + 1.)));
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 7022)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 7023)
@@ -56,4 +56,10 @@
 //  ===========================
 //
+//  Class Version 3:
+//  ----------------
+//   - enhanced SourceName and ProjectName by one character, because
+//     without telling us the guranteed trailing \0-character has
+//     skipped
+//
 //  Class Version 2:
 //  ----------------
@@ -101,6 +107,6 @@
     fRunType=kRTNone;  // use 0xffff for invalidation, 0 means: Data run
     fRunNumber=0;
-    fProjectName[0]=0;
-    fSourceName[0]=0;
+    memset(fProjectName, 0, 23);
+    memset(fSourceName, 0, 13);
     fSourceEpochChar[0]=0;
     fSourceEpochDate=0;
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 7022)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 7023)
@@ -43,6 +43,6 @@
     UShort_t  fRunType;
     UInt_t    fRunNumber;
-    Char_t    fProjectName[22];
-    Char_t    fSourceName[12];
+    Char_t    fProjectName[23];
+    Char_t    fSourceName[13];
     Char_t    fSourceEpochChar[2];
     UShort_t  fSourceEpochDate;
@@ -116,5 +116,5 @@
     Bool_t ReadEvt(istream& fin);
 
-    ClassDef(MRawRunHeader, 2)	// storage container for general info
+    ClassDef(MRawRunHeader, 3)	// storage container for general info
 };
 #endif
