Преглед на файлове

[components][dfs][dfs_v1]cat输出实际读取的长度

yangpeng преди 1 година
родител
ревизия
c9a1245977
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      components/dfs/dfs_v1/src/dfs_file.c

+ 1 - 1
components/dfs/dfs_v1/src/dfs_file.c

@@ -846,7 +846,7 @@ void cat(const char *filename)
         {
         {
             buffer[length] = '\0';
             buffer[length] = '\0';
             rt_device_t out_device = rt_console_get_device();
             rt_device_t out_device = rt_console_get_device();
-            rt_device_write(out_device, 0, (void *)buffer, sizeof(buffer));
+            rt_device_write(out_device, 0, (void *)buffer, length);
         }
         }
     } while (length > 0);
     } while (length > 0);
     rt_kprintf("\n");
     rt_kprintf("\n");