1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

istringstream_nocopy: Implement in a standards-compliant way.

Fixes the problem mentioned in e6a61b8da7

See #1135
This commit is contained in:
Shea Levy 2017-03-06 13:03:02 -05:00
parent 1cf4801108
commit 4fc30922cf
4 changed files with 89 additions and 15 deletions

View file

@ -104,7 +104,7 @@ Hash parseHash(HashType ht, const string & s)
string s2(s, i * 2, 2);
if (!isxdigit(s2[0]) || !isxdigit(s2[1]))
throw BadHash(format("invalid hash %1%") % s);
std::istringstream str(s2);
istringstream_nocopy str(s2);
int n;
str >> std::hex >> n;
hash.hash[i] = n;