diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-12-19 16:33:34 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-12-19 16:33:34 +0100 |
commit | 1d3495a0f09b1949efbba553a3d2a152ad2be617 (patch) | |
tree | d519a09e03943565fc634fc131ac7eeccb330174 /channels.c | |
parent | 9a8ef2b6c26aefe51e33db804a75ff5cfdb592f4 (diff) | |
download | vdr-1d3495a0f09b1949efbba553a3d2a152ad2be617.tar.gz vdr-1d3495a0f09b1949efbba553a3d2a152ad2be617.tar.bz2 |
Made several functions threadsafe
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 1.31 2004/11/02 18:07:05 kls Exp $ + * $Id: channels.c 1.32 2004/12/19 11:24:51 kls Exp $ */ #include "channels.h" @@ -705,7 +705,8 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID) p = apidbuf; char *q; int NumApids = 0; - while ((q = strtok(p, ",")) != NULL) { + char *strtok_next; + while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumApids < MAXAPIDS) { char *l = strchr(q, '='); if (l) { @@ -725,7 +726,8 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID) char *p = dpidbuf; char *q; int NumDpids = 0; - while ((q = strtok(p, ",")) != NULL) { + char *strtok_next; + while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumDpids < MAXAPIDS) { char *l = strchr(q, '='); if (l) { @@ -747,7 +749,8 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID) char *p = caidbuf; char *q; int NumCaIds = 0; - while ((q = strtok(p, ",")) != NULL) { + char *strtok_next; + while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumCaIds < MAXCAIDS) { caids[NumCaIds++] = strtol(q, NULL, 16) & 0xFFFF; if (NumCaIds == 1 && caids[0] <= 0x00FF) |