summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 79b7c347..98d2501f 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.139 2008/01/01 15:10:07 kls Exp $
+ * $Id: tools.c 1.140 2008/01/13 11:26:30 kls Exp $
*/
#include "tools.h"
@@ -873,6 +873,16 @@ cString &cString::operator=(const cString &String)
return *this;
}
+cString &cString::Truncate(int Index)
+{
+ int l = strlen(s);
+ if (Index < 0)
+ Index = l + Index;
+ if (Index >= 0 && Index < l)
+ s[Index] = 0;
+ return *this;
+}
+
cString cString::sprintf(const char *fmt, ...)
{
va_list ap;