WindowsInternals
WindowsInternals copied to clipboard
[UwpList] handling caps.txt line feed encoding
in UwpList.cpp in BuildCapabilityMap
string name(caps, cr - 1);
assumes \r\n
line feed but after getting sources, it was \n
only.
Thus string name(caps, cr-1);
creates a truncated string, as cr points at the last string char, and not one past it.
I suggest adding if (*(cr - 1) == '\r') cr--;
and then string name(caps, cr);
to be line feed agnostic.
this also makes sense with if (*cr == '\r') cr++;
later, as it can't be both \n
and '\r'.