From d370c44a9b5af1dab75595dc593560dbf93d630f Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 15 Jun 2009 12:15:19 +0200 Subject: [PATCH] - fix kernel dep rewriting [bnc#512726] --- src/repo_helix.c | 14 ++++---------- 1 file 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); -- 2.7.4