{
const char *name, *version, *release;
const uint_32 *epoch;
- struct rpm_header_index *epoch_header;
char evr[128], buf[16];
name = razor_rpm_get_indirect(rpm, RPMTAG_NAME, NULL);
version = razor_rpm_get_indirect(rpm, RPMTAG_VERSION, NULL);
release = razor_rpm_get_indirect(rpm, RPMTAG_RELEASE, NULL);
- if (epoch_header) {
+ if (epoch) {
snprintf(buf, sizeof buf, "%u", ntohl(*epoch));
razor_build_evr(evr, sizeof evr, buf, version, release);
} else {
strcpy(buffer, root);
p = buffer + strlen(buffer);
slash = path;
- for (slash = path; slash[1] != '\0'; slash = next) {
+ for (slash = path; *slash != '\0'; slash = next) {
next = strchr(slash + 1, '/');
+ if (next == NULL)
+ next = slash + strlen(slash);
+
memcpy(p, slash, next - slash);
p += next - slash;
*p = '\0';