12345678910111213141516171819202122232425262728293031323334353637 |
- From 7f6dd860818512c0eb313320308b22ba7e2c7205 Mon Sep 17 00:00:00 2001
- From: Rosen Penev <rosenp@gmail.com>
- Date: Fri, 4 Oct 2019 20:06:53 -0700
- Subject: [PATCH] istream_helpers: Fix sscanf typo
- This caused readin not to work properly with long long types.
- Found accidentally through a glibc warning
- (declared with warn_unused_result).
- Tested with gptfdisk on OpenWrt.
- Signed-off-by: Rosen Penev <rosenp@gmail.com>
- ---
- include/istream_helpers | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- --- a/include/istream_helpers
- +++ b/include/istream_helpers
- @@ -317,7 +317,7 @@ namespace std{
- sscanf(temp.c_str(), "%llo", (unsigned long long *)&var );
- }else if(stream.flags() & ios_base::hex){
- if(stream.flags() & ios_base::uppercase){
- - scanf(temp.c_str(), "%llX", (unsigned long long *)&var );
- + sscanf(temp.c_str(), "%llX", (unsigned long long *)&var );
- }else{
- sscanf(temp.c_str(), "%llx", (unsigned long long *)&var);
- }
- @@ -344,7 +344,7 @@ namespace std{
- sscanf(temp.c_str(), "%llo", &var );
- }else if(stream.flags() & ios_base::hex){
- if(stream.flags() & ios_base::uppercase){
- - scanf(temp.c_str(), "%llX", &var );
- + sscanf(temp.c_str(), "%llX", &var );
- }else{
- sscanf(temp.c_str(), "%llx", &var);
- }
|