-// Author: Benjamin Hess 25/09/2008
+// Author: Benjamin Hess 29/01/2010
/*************************************************************************
- * Copyright (C) 2008, Alexandru Bercuci, Benjamin Hess. *
+ * Copyright (C) 2009-2010, Alexandru Bercuci, Benjamin Hess. *
* All rights reserved. *
*************************************************************************/
// the list in the same way as for the TEveElementList). In general, //
// please use AddMacro(...) for this purpose. //
// Macros that are no longer needed can be removed from the list via //
-// RemoveSelectedMacros(...).This function takes an iterator of the //
+// RemoveSelectedMacros(...). This function takes an iterator of the //
// list of macros that are to be removed. //
-// be removed. An entry looks like: //
+// An entry looks like: //
// The data for each macro consists of path, name, type and the command //
// that will be used to apply the macro. This stuff is stored in a map //
// which takes the macro name for the key and the above mentioned data //
void SetCmd(const char* newCmd) // Sets the command that will be used to call this macro
{
memset(fCmd, '\0', sizeof(Char_t) * MAX_APPLY_COMMAND_LENGTH);
- sprintf(fCmd, "%s", newCmd);
+ snprintf(fCmd, MAX_APPLY_COMMAND_LENGTH, "%s", newCmd);
}
void SetName(const char* newName) // Sets the macro name (please use without ".C")
{
memset(fName, '\0', sizeof(Char_t) * MAX_MACRO_NAME_LENGTH);
- sprintf(fName, "%s", newName);
+ snprintf(fName, MAX_MACRO_NAME_LENGTH, "%s", newName);
}
void SetPath(const char* newPath) // Sets the path of the macro
{
memset(fPath, '\0', sizeof(Char_t) * MAX_MACRO_PATH_LENGTH);
- sprintf(fPath, "%s", newPath);
+ snprintf(fPath, MAX_MACRO_PATH_LENGTH, "%s", newPath);
}
void SetSelected(Bool_t selection) // Sets whether the macro is selected or not
{