diff options
author | Julian Oes <julian@oes.ch> | 2014-02-05 21:19:25 +0100 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-02-05 21:19:25 +0100 |
commit | 3392086f8f317823061363296c8d3e18be4ee88e (patch) | |
tree | 39216aa42de253d45fac793cb9237a7b058779de /src/modules/systemlib | |
parent | 8a48a4916c49af019bc28766bbf9eff6dfee2a82 (diff) | |
download | px4-firmware-3392086f8f317823061363296c8d3e18be4ee88e.tar.gz px4-firmware-3392086f8f317823061363296c8d3e18be4ee88e.tar.bz2 px4-firmware-3392086f8f317823061363296c8d3e18be4ee88e.zip |
Mixer load: don't upload empty mixers from non-existing files
Diffstat (limited to 'src/modules/systemlib')
-rw-r--r-- | src/modules/systemlib/mixer/mixer_load.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/systemlib/mixer/mixer_load.c b/src/modules/systemlib/mixer/mixer_load.c index a55ddf8a3..b05273c0d 100644 --- a/src/modules/systemlib/mixer/mixer_load.c +++ b/src/modules/systemlib/mixer/mixer_load.c @@ -52,7 +52,8 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen) /* open the mixer definition file */ fp = fopen(fname, "r"); if (fp == NULL) { - return 1; + warnx("file not found"); + return -1; } /* read valid lines from the file into a buffer */ @@ -88,7 +89,8 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen) /* if the line is too long to fit in the buffer, bail */ if ((strlen(line) + strlen(buf) + 1) >= maxlen) { - return 1; + warnx("line too long"); + return -1; } /* add the line to the buffer */ |