chiark / gitweb /
switch tools and volume_id from LGPL to GPLv2
[elogind.git] / extras / firmware / firmware_helper.c
index 283ea9f76fc2bfb3562a74740dea56a73fead91b..2bc6b50f0672df99ef46f23b3974f71694d60194 100644 (file)
@@ -3,13 +3,9 @@
  * 
  * Copyright 2005 Red Hat, Inc.
  *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ *     This program is free software; you can redistribute it and/or modify it
+ *     under the terms of the GNU General Public License as published by the
+ *     Free Software Foundation version 2 of the License.
  */
 
 #include <errno.h>
@@ -109,7 +105,7 @@ int main(int argc, char **argv) {
        }
 
        snprintf(data_path, sizeof(data_path), "/sys/%s/data", devpath);
-       fw_path[sizeof(data_path)-1] = '\0';
+       data_path[sizeof(data_path)-1] = '\0';
        fw_fd = open(data_path, O_RDWR);
        if (fw_fd < 0) {
                rc = errno;
@@ -118,9 +114,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);