Use QUOTEDSTRLEN macro instead of sizeof or strlen

This commit is contained in:
Rangi42
2024-03-27 11:50:48 -04:00
parent 912a1504ec
commit dcb4e40388
5 changed files with 16 additions and 11 deletions

View File

@@ -632,9 +632,9 @@ static std::tuple<DefaultInitVec<size_t>, std::vector<Palette>>
char *ptr = buf;
for (uint16_t cgbColor : list) {
sprintf(ptr, ", $%04x", cgbColor);
ptr += 7;
ptr += QUOTEDSTRLEN(", $XXXX");
}
return &buf[2];
return &buf[QUOTEDSTRLEN(", ")];
};
// Iterate through proto-palettes, and try mapping them to the specified palettes