1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

Welcome: Remove crash and ensure text doesn't all stay on one line.

When size_t replaced int (6f4c370), it caused the 'start = -1' trick to
fail, setting start to (unsigned)-1 instead. This then caused
String.substring to fail, as that is a little bit higher than the length
of the string! This resulted in an outright crash.

Later, the builder is not reset before making a new line. This causes
the line to simply be the earlier one, but with more text on it.

(There's also a few changes from clang-format, namely the #include
reorganization.)

Fixes #1211 (although I wasn't aware of it when I made this commit).
This commit is contained in:
thatlittlegit 2020-02-13 22:53:45 -05:00 committed by Andreas Kling
parent f27a646bf5
commit d647749737
2 changed files with 4 additions and 3 deletions

View file

@ -28,8 +28,8 @@
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibGfx/TextAlignment.h>
#include <LibGUI/Frame.h>
#include <LibGfx/TextAlignment.h>
class TextWidget : public GUI::Frame {
C_OBJECT(TextWidget)