projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba85f10
)
Use rstrlcpy() for parseRCPOT() version + release
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 17 Apr 2008 15:04:28 +0000
(18:04 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 17 Apr 2008 15:04:28 +0000
(18:04 +0300)
- just avoids manual zero-termination
build/parseReqs.c
patch
|
blob
|
history
diff --git
a/build/parseReqs.c
b/build/parseReqs.c
index
3913c97
..
417ea5f
100644
(file)
--- 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;