aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-10-14 00:38:28 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-10-14 00:38:28 +0000
commit0eae00d29128a2dbda34ee64c3198a598bc93203 (patch)
treeea4b8eb7290de5d98b52260547cb37750701b660
parent9b69daf37005d064e0dfc0a1dc50b51a5c2314bb (diff)
downloadperl-URPM-0eae00d29128a2dbda34ee64c3198a598bc93203.tar
perl-URPM-0eae00d29128a2dbda34ee64c3198a598bc93203.tar.gz
perl-URPM-0eae00d29128a2dbda34ee64c3198a598bc93203.tar.bz2
perl-URPM-0eae00d29128a2dbda34ee64c3198a598bc93203.tar.xz
perl-URPM-0eae00d29128a2dbda34ee64c3198a598bc93203.zip
as atoi() is able to figure out that '@' isn't a digit, there's no need for swapping it
-rw-r--r--URPM.xs4
1 files changed, 1 insertions, 3 deletions
diff --git a/URPM.xs b/URPM.xs
index a64f174..4cf3928 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1972,12 +1972,10 @@ Pkg_size(pkg)
URPM::Package pkg
CODE:
if (pkg->info) {
- char *s, *eos;
+ char *s;
if ((s = strchr(pkg->info, '@')) != NULL && (s = strchr(s+1, '@')) != NULL) {
- if ((eos = strchr(s+1, '@')) != NULL) *eos = 0; /* mark end of string to enable searching backwards */
RETVAL = atoi(s+1);
- if (eos != NULL) *eos = '@';
} else {
RETVAL = 0;
}