summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-03-17 18:11:01 +0000
committerjbj <devnull@localhost>1999-03-17 18:11:01 +0000
commitd84c548c0ba241ceb19e2a9c1aa457cf5652098d (patch)
tree003f16cf25d03c33541fb4359d2cf3ae2501bd68 /build.c
parentfa3c0712e2b60521415cad49de6c2ab762959242 (diff)
downloadlibrpm-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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/build.c b/build.c
index 0a426de0f..1f39b26d7 100644
--- a/build.c
+++ b/build.c
@@ -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);