diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-17 18:04:28 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-17 18:04:28 +0300 |
commit | 567c0abc7eb558318077feed34a1edde9fafcaf0 (patch) | |
tree | 3fc51e62cd8fb44bf5a3090ab9c859c1cbcb1e6e | |
parent | ba85f103e59db924f4dfba7de56bcba8ae311e3c (diff) | |
download | rpm-567c0abc7eb558318077feed34a1edde9fafcaf0.tar.gz rpm-567c0abc7eb558318077feed34a1edde9fafcaf0.tar.bz2 rpm-567c0abc7eb558318077feed34a1edde9fafcaf0.zip |
Use rstrlcpy() for parseRCPOT() version + release
- just avoids manual zero-termination
-rw-r--r-- | build/parseReqs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/build/parseReqs.c b/build/parseReqs.c index 3913c972d..417ea5fc1 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -111,8 +111,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN, re = r; SKIPNONWHITE(re); N = xmalloc((re-r) + 1); - strncpy(N, r, (re-r)); - N[re-r] = '\0'; + rstrlcpy(N, r, (re-r)); /* Parse EVR */ v = re; @@ -166,8 +165,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN, return RPMRC_FAIL; } EVR = xmalloc((ve-v) + 1); - strncpy(EVR, v, (ve-v)); - EVR[ve-v] = '\0'; + rstrlcpy(EVR, v, (ve-v)); re = ve; /* ==> next token after EVR string starts here */ } else EVR = NULL; |