Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not ignore fread results to keep ubuntu compiler happy
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 14 Jul 2009 08:44:33 +0000 (08:44 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 14 Jul 2009 08:44:33 +0000 (08:44 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6503 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/xbt_str.c

index a3add85..fc0b7ff 100644 (file)
@@ -709,8 +709,8 @@ char* xbt_str_from_file(FILE *file) {
   memset(bread,0,1024);
 
   while (!feof(file)) {
-    fread(bread, 1, 1023, file);
-    bread[1023] = '\0';
+    int got = fread(bread, 1, 1023, file);
+    bread[got] = '\0';
     xbt_strbuff_append(buff,bread);
   }