Index: hvcontrol/src/HV.cc
===================================================================
--- hvcontrol/src/HV.cc	(revision 226)
+++ hvcontrol/src/HV.cc	(revision 229)
@@ -14,30 +14,24 @@
 #include "ProcessIO.h" // Must be not in HV.h to avoid problem with declaring class ProcessIO
 
+using namespace std;
+
 // Constructor
-HVBoard::HVBoard(int DeviceNumber, char *DeviceName, class ProcessIO *PIO) {
+HVBoard::HVBoard(int DeviceNumber, string Name, class ProcessIO *PIO) {
    
-  char *Buffer;
   struct termios tio;
  
   m = PIO;
-
   SetTimeOut(m->fTimeOut);
   BoardNumber = DeviceNumber;
-  BoardName = DeviceName;
-  
+  BoardName = new char [Name.size()+1];
+  strcpy(BoardName, Name.c_str());
+  
+  stringstream Buf;
+  Buf << setw(2) << BoardNumber;
+  string Result =Buf.str();
+
   // Create DIM services
-  if (asprintf(&Buffer, SERVER_NAME"/NAME/ID%.2d", BoardNumber) == -1) {
-    m->PrintMessage(All, "asprintf() failed for DIM service name creation\n");
-	return;
-  }
-  Name = new DimService (Buffer, BoardName);
-  free(Buffer);
-  
-  if (asprintf(&Buffer, SERVER_NAME"/VOLT/ID%.2d", BoardNumber) == -1) {
-    m->PrintMessage(All, "asprintf() failed for DIM service name creation\n");
-	return;
-  }
-  BiasVolt = new DimService (Buffer, "D", HVV, NUM_CHAINS*NUM_CHANNELS*sizeof(double));
-  free(Buffer);
+  NameService = new DimService ((SERVER_NAME"/NAME/ID"+Result).c_str(), BoardName);
+  BiasVolt = new DimService ((char *) (SERVER_NAME"/VOLT/ID"+Result).c_str(), (char *) "D", HVV, NUM_CHAINS*NUM_CHANNELS*sizeof(double));
 
   for (int i=0; i<NUM_CHAINS; i++) Overcurrent[i] = false;
@@ -49,15 +43,8 @@
   ClearVoltageArrays();
 
-  // Open device (do not warn on non-existing device)
-  if (asprintf(&Buffer, "/dev/%s",DeviceName) == -1) {
-    m->PrintMessage(All, "asprintf() failed for device name creation\n");
-	return;
-  }
-  if ((fDescriptor = open(Buffer, O_RDWR|O_NOCTTY|O_NDELAY)) == -1) {
-    if(errno != 2) m->PrintMessage(All, "Error: Could not open device %d/%s (%s)\n", DeviceNumber,DeviceName, strerror(errno));
-	free(Buffer);
+  if ((fDescriptor = open(("/dev/"+Name).c_str(), O_RDWR|O_NOCTTY|O_NDELAY)) == -1) {
+    if(errno != 2) m->PrintMessage(All, "Error: Could not open device %d/%s (%s)\n", DeviceNumber, Name.c_str(), strerror(errno));
     return;
   }
-  free(Buffer);
 
   // Get current serial port settings
@@ -96,6 +83,7 @@
   }
 
-  delete Name;
+  delete NameService;
   delete BiasVolt;
+  delete[] BoardName;
 }
 
Index: hvcontrol/src/HV.h
===================================================================
--- hvcontrol/src/HV.h	(revision 226)
+++ hvcontrol/src/HV.h	(revision 229)
@@ -8,4 +8,5 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
+#include <string>
 
 #include "dis.hxx"
@@ -39,5 +40,5 @@
  public:
   
-   HVBoard(int, char *, class ProcessIO *);
+   HVBoard(int, std::string, class ProcessIO *);
    ~HVBoard();
 
@@ -54,5 +55,5 @@
    double HVV[NUM_CHAINS][NUM_CHANNELS];  // HV value in volts
 
-   DimService *Name;
+   DimService *NameService;
    DimService *BiasVolt;
 
Index: hvcontrol/src/ProcessIO.cc
===================================================================
--- hvcontrol/src/ProcessIO.cc	(revision 226)
+++ hvcontrol/src/ProcessIO.cc	(revision 229)
@@ -12,5 +12,5 @@
 #include "ProcessIO.h"
 
-static char* state_str[]    = {"active", "stopped", "n.a."};
+static const char* state_str[]    = {"active", "stopped", "n.a."};
 
 // Branch table for command evaluation
@@ -63,30 +63,28 @@
 
   // Get configuration data
-  char *Boards = GetConfig("Boards");
+  vector<string> Boards = Tokenize(GetConfig("Boards"), " \t");
   fPixMapTable = GetConfig("PixMapTable");
-  fTimeOut = atof(GetConfig("TimeOut"));
-  fStatusRefreshRate = atof(GetConfig("StatusRefreshRate"));
-  DACMin = atoi(GetConfig("DACMin"));
-  DACMax = atoi(GetConfig("DACMax"));
-  fHVCalibOffset = atof(GetConfig("HVCalibOffset"));
-  fHVCalibSlope = atof(GetConfig("HVCalibSlope"));
-  fHVMaxDiff = atoi(GetConfig("HVMaxDiff"));
+  fTimeOut = atof(GetConfig("TimeOut").c_str());
+  fStatusRefreshRate = atof(GetConfig("StatusRefreshRate").c_str());
+  DACMin = atoi(GetConfig("DACMin").c_str());
+  DACMax = atoi(GetConfig("DACMax").c_str());
+  fHVCalibOffset = atof(GetConfig("HVCalibOffset").c_str());
+  fHVCalibSlope = atof(GetConfig("HVCalibSlope").c_str());
+  fHVMaxDiff = atoi(GetConfig("HVMaxDiff").c_str());
 
   if (fStatusRefreshRate < MIN_RATE || fStatusRefreshRate > MAX_RATE)  fStatusRefreshRate = 1;
 
   // Open HV devices
-  fHVBoard = new HVBoard* [strlen(Boards)]; 
-  char *Token = strtok(Boards, " \t");
-  while (Token != NULL) {
-    fHVBoard[NumHVBoards] = new HVBoard(NumHVBoards, Token, this);
+  fHVBoard = new HVBoard* [Boards.size()]; 
+  for (unsigned int i=0; i<Boards.size(); i++) {
+    fHVBoard[NumHVBoards] = new HVBoard(NumHVBoards, Boards[i], this);
     if(fHVBoard[NumHVBoards]->fDescriptor >= 0) {
-       PrintMessage("Synchronized and reset board %d (%s)\n",NumHVBoards,fHVBoard[NumHVBoards]->BoardName);
+       PrintMessage("Synchronized and reset board %d (%s)\n", NumHVBoards, fHVBoard[NumHVBoards]->BoardName);
        NumHVBoards++;
     }
     else {
-      PrintMessage(All, "Failed to synchronize board %d (%s)\n",NumHVBoards,fHVBoard[NumHVBoards]->BoardName);
+      PrintMessage(All, "Failed to synchronize board %d (%s)\n", NumHVBoards, fHVBoard[NumHVBoards]->BoardName);
       delete fHVBoard[NumHVBoards];
     }
-	Token = strtok(NULL, " \t");
   }
   LastBoard = NumHVBoards-1;
@@ -199,5 +197,5 @@
 
   PrintMessage( " Pixel map table:   %s\n"
-    	    	" %d USB devices:\n", fPixMapTable, NumHVBoards);  
+    	    	" %d USB devices:\n", fPixMapTable.c_str(), NumHVBoards);  
 
   for (int i=0; i<NumHVBoards; i++) PrintMessage(" Board %d: %s\n", i, fHVBoard[i]->BoardName);
Index: hvcontrol/src/ProcessIO.h
===================================================================
--- hvcontrol/src/ProcessIO.h	(revision 226)
+++ hvcontrol/src/ProcessIO.h	(revision 229)
@@ -7,4 +7,5 @@
 #include <math.h>
 #include <signal.h>
+#include <string>
 
 #define SERVER_NAME "Bias"       // Name to use in DIM
@@ -46,5 +47,5 @@
 
 	// Configuration data
-	char *fPixMapTable;
+	std::string fPixMapTable;
 	float fTimeOut;
 	float fStatusRefreshRate;
