diff options
author | jbj <devnull@localhost> | 1999-03-17 18:11:01 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-03-17 18:11:01 +0000 |
commit | d84c548c0ba241ceb19e2a9c1aa457cf5652098d (patch) | |
tree | 003f16cf25d03c33541fb4359d2cf3ae2501bd68 /build.c | |
parent | fa3c0712e2b60521415cad49de6c2ab762959242 (diff) | |
download | librpm-tizen-d84c548c0ba241ceb19e2a9c1aa457cf5652098d.tar.gz librpm-tizen-d84c548c0ba241ceb19e2a9c1aa457cf5652098d.tar.bz2 librpm-tizen-d84c548c0ba241ceb19e2a9c1aa457cf5652098d.zip |
fix: recursive strtok's is a no-no.
CVS patchset: 2894
CVS date: 1999/03/17 18:11:01
Diffstat (limited to 'build.c')
-rw-r--r-- | build.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -170,7 +170,7 @@ int build(const char *arg, int buildAmount, const char *passPhrase, const char *buildRoot, int fromTarball, int test, char *cookie, const char * rcfile, char *targets, int force) { - char *target, *t; + char *t, *te; int rc; if (targets == NULL) { @@ -183,9 +183,10 @@ int build(const char *arg, int buildAmount, const char *passPhrase, printf("Building target platforms: %s\n", targets); - t = targets; - while((target = strtok(t, ",")) != NULL) { - t = NULL; + for (t = targets; (te = strchr(t, ',')) != NULL; t = te) { + char *target = alloca(te-t+1); + strncpy(target, t, (te-t)); + target[te-t] = '\0'; printf("Building for target %s\n", target); rpmReadConfigFiles(rcfile, target); |