summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-09-09 14:57:43 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-09-09 14:57:43 +0200
commitc00d4ea326e61d76d7ab5760a5c06646d6b88ab0 (patch)
tree2462fd5c1759f451d8f1c54cedc10b5b0d74cfd1 /tools.c
parentd4eb96f725bed149762665ddee275301c9f069a6 (diff)
downloadvdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.gz
vdr-c00d4ea326e61d76d7ab5760a5c06646d6b88ab0.tar.bz2
Implemented 'channel grouping'
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 0dca69ee..e081ee79 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.13 2000/07/29 18:41:45 kls Exp $
+ * $Id: tools.c 1.14 2000/09/09 12:53:34 kls Exp $
*/
#define _GNU_SOURCE
@@ -97,6 +97,14 @@ char *readline(FILE *f)
return NULL;
}
+char *strn0cpy(char *dest, const char *src, size_t n)
+{
+ char *s = dest;
+ for ( ; --n && (*dest = *src) != 0; dest++, src++) ;
+ *dest = 0;
+ return s;
+}
+
char *strreplace(char *s, char c1, char c2)
{
char *p = s;
@@ -418,6 +426,8 @@ void cListBase::Clear(void)
cListObject *cListBase::Get(int Index)
{
+ if (Index < 0)
+ return NULL;
cListObject *object = objects;
while (object && Index-- > 0)
object = object->Next();