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 <ros...@gmail.com>
---
 include/istream_helpers | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/istream_helpers b/include/istream_helpers
index f2c793f..f8db903 100644
--- 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);
                                        }
-- 
2.17.1

_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to