@@ -255,10 +255,10 @@ static int scan_loaded_modules(void)
struct module m;
struct module *n;
- m.name = strtok(buf, " ");
- m.size = atoi(strtok(NULL, " "));
- m.usage = atoi(strtok(NULL, " "));
- m.depends = strtok(NULL, " ");
+ m.name = strsep(&buf, " ");
+ m.size = atoi(strsep(&buf " "));
+ m.usage = atoi(strsep(&buf, " "));
+ m.depends = strsep(&buf, " ");
if (!m.name || !m.depends)
continue;
@@ -12,7 +12,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
- * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
+ * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
*/
#include <stdio.h>
@@ -148,10 +148,10 @@ static int init_services(void)
instances = blobmsg_open_table(&b, "instances");
instance = blobmsg_open_table(&b, "instance");
command = blobmsg_open_array(&b, "command");
- t = strtok(i->exec, " ");
+ t = strsep(&i->exec, " ");
while (t) {
blobmsg_add_string(&b, NULL, t);
- t = strtok(NULL, " ");
+ t = strsep(&i->exec, " ");
}
blobmsg_close_array(&b, command);
blobmsg_close_table(&b, instance);
@@ -178,7 +178,7 @@ dt_type_list(struct dt_state *s, int nargs)
return false;
}
- for (p = strtok(str, " \t"); p; p = strtok(NULL, " \t"))
+ for (p = strsep(&str, " \t"); p; p = strsep(&strx, " \t"))
{
s->value = p;