Skip to content

Commit dd3a0f6

Browse files
committed
fix(util): fix improper handling of BOTTOM in StringToJustify
1 parent 74bc963 commit dd3a0f6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/util/StringTo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int32_t StringToJustify(const char* string, uint32_t& justify) {
141141
const char* string;
142142
};
143143

144-
static JustifyEntry justifyMap[6] = {
144+
static JustifyEntry justifyMap[] = {
145145
{ 0x1, "LEFT" },
146146
{ 0x2, "CENTER" },
147147
{ 0x4, "RIGHT" },
@@ -150,9 +150,9 @@ int32_t StringToJustify(const char* string, uint32_t& justify) {
150150
{ 0x20, "BOTTOM" }
151151
};
152152

153-
for (int32_t i = 0; i < 5; i++) {
154-
if (!SStrCmpI(justifyMap[i].string, string, 0x7FFFFFFFu)) {
155-
justify = justifyMap[i].value;
153+
for (const auto& entry : justifyMap) {
154+
if (!SStrCmpI(entry.string, string)) {
155+
justify = entry.value;
156156
return 1;
157157
}
158158
}

0 commit comments

Comments
 (0)