From c00d4ea326e61d76d7ab5760a5c06646d6b88ab0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 9 Sep 2000 14:57:43 +0200 Subject: Implemented 'channel grouping' --- tools.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools.c') 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(); -- cgit v1.2.3