From b746dbc136576f3b748f5d709f5eb625896b8439 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 1 Oct 2012 11:37:01 +0300 Subject: Avoid using/modifying fsm->li on hard link checking - Using a "global" variable for local iteration is just dumb... --- lib/fsm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/fsm.c') diff --git a/lib/fsm.c b/lib/fsm.c index 676ebbbd7..4d1db7fdc 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -553,10 +553,10 @@ static int checkHardLinks(FSM_t fsm) int rc = 0; rpmfs fs = fsmGetFs(fsm); - for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) { - if (fsm->li->linksLeft) { - for (nlink_t i = 0 ; i < fsm->li->linksLeft; i++) { - int ix = fsm->li->filex[i]; + for (hardLink_t li = fsm->links; li != NULL; li = li->next) { + if (li->linksLeft) { + for (nlink_t i = 0 ; i < li->linksLeft; i++) { + int ix = li->filex[i]; if (ix < 0 || XFA_SKIPPING(rpmfsGetAction(fs, ix))) continue; rc = CPIOERR_MISSING_HARDLINK; -- cgit v1.2.3