summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-13 17:18:42 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-13 17:18:42 +0000
commitc2325703f1ba2889eff8ad2ef43fb38c958931d7 (patch)
treee000e06770e818044f4b7d2bae9acf2a4b6ab36c /nuttx/tools
parentd0662978dcc62ea76bb4ec9f45ae3e043597f3c8 (diff)
downloadpx4-nuttx-c2325703f1ba2889eff8ad2ef43fb38c958931d7.tar.gz
px4-nuttx-c2325703f1ba2889eff8ad2ef43fb38c958931d7.tar.bz2
px4-nuttx-c2325703f1ba2889eff8ad2ef43fb38c958931d7.zip
Oops.. nested strtok in mkdeps.c, need to use strtok_r
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5345 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/tools')
-rw-r--r--nuttx/tools/mkdeps.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nuttx/tools/mkdeps.c b/nuttx/tools/mkdeps.c
index f2a196387..a90595c98 100644
--- a/nuttx/tools/mkdeps.c
+++ b/nuttx/tools/mkdeps.c
@@ -288,6 +288,7 @@ static void do_dependency(const char *file, char separator)
struct stat buf;
char *altpath;
char *path;
+ char *lasts;
int cmdlen;
int pathlen;
int filelen;
@@ -330,15 +331,15 @@ static void do_dependency(const char *file, char separator)
/* Add a space */
command[cmdlen] = ' ';
- command[cmdlen+1] = '\0';
cmdlen++;
+ command[cmdlen] = '\0';
/* Try each path. This loop will continue until each path has been tried
* (failure) or until stat() finds the file
*/
altpath = g_altpath;
- while ((path = strtok(altpath, " ")) != NULL)
+ while ((path = strtok_r(altpath, " ", &lasts)) != NULL)
{
/* Create a full path to the file */
@@ -565,6 +566,7 @@ static void do_winpath(char *file)
int main(int argc, char **argv, char **envp)
{
+ char *lasts;
char *files;
char *file;
@@ -575,7 +577,7 @@ int main(int argc, char **argv, char **envp)
/* Then generate dependencies for each path on the command line */
files = g_files;
- while ((file = strtok(files, " ")) != NULL)
+ while ((file = strtok_r(files, " ", &lasts)) != NULL)
{
/* Check if we need to do path conversions for a Windows-natvie tool
* being using in a POSIX/Cygwin environment.