aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs10
1 files changed, 7 insertions, 3 deletions
diff --git a/URPM.xs b/URPM.xs
index 1b11530..0e34dd5 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -273,9 +273,13 @@ pretend_distepoch(Header header, int32_t names_tag, int32_t flags_tag, int32_t v
name2[names.count-1] = name[flags.ix];
flag2[names.count-1] = (flag[flags.ix] | RPMSENSE_LESS) & ~RPMSENSE_EQUAL;
flag2[flags.ix] |= RPMSENSE_GREATER;
- version2[names.count-1] = strdup(version[flags.ix]);
- char *v = version2[names.count-1];
- (*(&v[strlen(v)-1]))++;
+ version2[names.count-1] = calloc(strlen(version[flags.ix])+2, 1);
+ char *v = stpcpy(version2[names.count-1], version[flags.ix]);
+ if (v[-1] == '9') {
+ v[-1] = '1';
+ v[0] = '0';
+ } else
+ (*(&v[-1]))++;
}
}
if(name) {