chiark / gitweb /
firmware_helper: fix write count
authorDuncan Sands <baldrick@free.fr>
Fri, 9 Sep 2005 10:38:58 +0000 (12:38 +0200)
committerKay Sievers <kay.sievers@suse.de>
Fri, 9 Sep 2005 10:38:58 +0000 (12:38 +0200)
extras/firmware/firmware_helper.c

index 7b7a307..4581513 100644 (file)
@@ -118,9 +118,9 @@ int main(int argc, char **argv) {
 
        count = 0;
        while (count < fw_buffer_size) {
-               int c;
+               ssize_t c;
 
-               c = write(fw_fd, fw_buffer+count, fw_buffer_size);
+               c = write(fw_fd, fw_buffer+count, fw_buffer_size-count);
                if (c <= 0) {
                        rc = errno;
                        close(fw_fd);