Skip to content
This repository
Browse code

fixed, sometimes an ferror was returned when using fread, switch to f…

…gets like most other usage of popen
  • Loading branch information...
commit 795a693c4ce59ce4ea62004e98160aa9d507a5f1 1 parent c0d1de1
authored May 11, 2013

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  xbmc/utils/SystemInfo.cpp
4  xbmc/utils/SystemInfo.cpp
@@ -684,8 +684,8 @@ CStdString CSysInfo::GetUnameVersion()
684 684
   FILE* pipe = popen("uname -rm", "r");
685 685
   if (pipe)
686 686
   {
687  
-    char buffer[256] = {'\0'};
688  
-    if (fread(buffer, sizeof(char), sizeof(buffer), pipe) > 0 && !ferror(pipe))
  687
+    char buffer[256];
  688
+    if (fgets(buffer, sizeof(buffer), pipe))
689 689
     {
690 690
       result = buffer;
691 691
 #if defined(TARGET_DARWIN)

0 notes on commit 795a693

Please sign in to comment.
Something went wrong with that request. Please try again.