From b711b2f7379554621ad78990bc4f74ac8e034d5a Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Thu, 19 Sep 2013 14:12:31 +0200 Subject: The length of the first part must always be added to the position in the second wrapped part. --- ufed-curses-checklist.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index 48e6606..6a48ba7 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -781,16 +781,14 @@ static void setFlagWrapDraw(sFlag* flag, int index, sWrap** wrap, size_t* pos, s && !wrapPart->pos) *isFirstWrap = false; - // Position and length can be written back already + // The length and position can be written back already *pos = wrapPart->pos; *len = wrapPart->len; - // If this was switched, add the first length - if ((false == *isFirstWrap) && (0 == *pos)) { - // Add the length of either the package list or the - // description (stripped or normal) or drawFlag will - // end up reprinting from the beginning due to the - // unified description string. + // If this is the second part, the length of the first + // must be added to the position, or drawflag() will + // start all over again. + if (false == *isFirstWrap) { if (eOrder_left == e_order) *pos += sizeof(flag->desc[index].pkg); else -- cgit v1.2.3-65-gdbad