Skip to content

Commit c6e3997

Browse files
author
nicm
committed
Do not loop forever if there is a nonprintable character in the format.
1 parent b9022e3 commit c6e3997

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

format-draw.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ format_trim_left(const char *expanded, u_int limit)
837837
*out++ = *cp;
838838
width++;
839839
cp++;
840-
}
840+
} else
841+
cp++;
841842
}
842843
*out = '\0';
843844
return (copy);
@@ -883,7 +884,8 @@ format_trim_right(const char *expanded, u_int limit)
883884
*out++ = *cp;
884885
width++;
885886
cp++;
886-
}
887+
} else
888+
cp++;
887889
}
888890
*out = '\0';
889891
return (copy);

0 commit comments

Comments
 (0)