]> sigrok.org Git - sigrok-cli.git/commitdiff
Fix a compiler warning.
authorUwe Hermann <redacted>
Fri, 19 Sep 2014 10:39:33 +0000 (12:39 +0200)
committerUwe Hermann <redacted>
Fri, 19 Sep 2014 11:29:41 +0000 (13:29 +0200)
input.c: In function ‘load_input_file’:
input.c:123:7: warning: ‘fd’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   len = read(fd, buf->str, BUFSIZE);
       ^
input.c:42:6: note: ‘fd’ was declared here
  int fd;
      ^

input.c

diff --git a/input.c b/input.c
index eb73d05d197b217b1cd717f878c1c4941685d376..da4e21d14b2d9ad49916c32b3b3a67445c5d6308 100644 (file)
--- a/input.c
+++ b/input.c
@@ -39,7 +39,7 @@ static void load_input_file_module(void)
        struct sr_dev_inst *sdi;
        GHashTable *mod_args, *mod_opts;
        GString *buf;
-       int fd;
+       int fd = 0;
        ssize_t len;
        char *mod_id;