summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-09-22 13:07:43 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-09-22 13:07:43 +0200
commit14992a803752c35a92e9396838d01fbd38ba2f60 (patch)
tree3abb2e322f8693b90a31036aec1701f4136bb4c9 /tools.c
parent935cfc26833c1c577423a1de83e0aa0f937bf08e (diff)
downloadvdr-14992a803752c35a92e9396838d01fbd38ba2f60.tar.gz
vdr-14992a803752c35a92e9396838d01fbd38ba2f60.tar.bz2
EPG info is now updated if the contents changes but the ID remains the same
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index d6b65e55..7238137e 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.45 2001/09/15 15:41:16 kls Exp $
+ * $Id: tools.c 1.46 2001/09/22 12:13:40 kls Exp $
*/
#define _GNU_SOURCE
@@ -64,6 +64,19 @@ char *readline(FILE *f)
return NULL;
}
+char *strcpyrealloc(char *dest, const char *src)
+{
+ if (src) {
+ int l = max(dest ? strlen(dest) : 0, strlen(src)) + 1; // don't let the block get smaller!
+ dest = (char *)realloc(dest, l);
+ if (dest)
+ strcpy(dest, src);
+ else
+ esyslog(LOG_ERR, "ERROR: out of memory");
+ }
+ return dest;
+}
+
char *strn0cpy(char *dest, const char *src, size_t n)
{
char *s = dest;