Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - fix kernel dep rewriting [bnc#512726]
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Mon, 15 Jun 2009 12:15:19 +0200
  • Message-id: <E1MG9E6-0004Cd-TA@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit decac4534f75d6f89959fd89f7e6da4d2bb31fa4
Author: Michael Schroeder <mls@xxxxxxx>
Date: Mon Jun 15 12:15:19 2009 +0200

- fix kernel dep rewriting [bnc#512726]
---
src/repo_helix.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/repo_helix.c b/src/repo_helix.c
index 01e08e3..ebeff07 100644
--- a/src/repo_helix.c
+++ b/src/repo_helix.c
@@ -658,13 +658,10 @@ endElement(void *userData, const char *name)
}


- if (!strncmp(depname, "kernel(", strlen("kernel(")) &&
!strchr(depname, ':'))
+ if (!strncmp(depname, "kernel(", 7) && !strchr(depname, ':'))
{
char newdep[100];
- strcpy(newdep, "kernel(");
- strncat(newdep, cflavor, sizeof(newdep) - 1);
- strncat(newdep, ":", sizeof(newdep) - 1);
- strncat(newdep, depname + strlen("kernel("),
sizeof(newdep) - 1);
+ snprintf(newdep, sizeof(newdep), "kernel(%s:%s", cflavor,
depname + 7);
pid = str2id(pool, newdep, 1);
if (prd)
pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
@@ -695,13 +692,10 @@ endElement(void *userData, const char *name)
depname = id2str(pool, pid);
}

- if (!strncmp(depname, "kernel(", strlen("kernel(")) &&
!strchr(depname, ':'))
+ if (!strncmp(depname, "kernel(", 7) && !strchr(depname, ':'))
{
char newdep[100];
- strcpy(newdep, "kernel(");
- strncat(newdep, cflavor, sizeof(newdep) - 1);
- strncat(newdep, ":", sizeof(newdep) - 1);
- strncat(newdep, depname + strlen("kernel("),
sizeof(newdep) - 1);
+ snprintf(newdep, sizeof(newdep), "kernel(%s:%s", cflavor,
depname + 7);
pid = str2id(pool, newdep, 1);
if (prd)
pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages