microsoft / SizeBench

SizeBench is a binary size investigation tool for Windows
MIT License
103 stars 14 forks source link

Fix max length of excel export for each cell #35

Closed Austin-Lamb closed 7 months ago

Austin-Lamb commented 7 months ago

Why is this change being made?

A customer reported that Excel export was failing because the max length of a cell was exceeded.

Briefly summarize what changed

Excel limits each cell to 32,767 characters. This is usually enough, but for some cases C++ template names sure do get...long and ugly. So they can exceed this and then we'd throw an exception and crash when trying to export data.

So, now we truncate strings to 32.767 charcaters and put "..." at the end if we can't fit it all. It means we lose data, but there's no way I can see to do better, so at least this avoids a crash. It's unlikely a human would read >32K characters in an Excel cell anyway.

How was the change tested?

Manually.

PR Checklist