diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2016-12-07 19:04:45 -0800 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-12-09 13:06:06 +0100 |
commit | a4e49b4163b28b2d12e718e66c4fcba87acef33e (patch) | |
tree | 442565686aacca891c994d3bc2320bfe411c85ce /uclient-http.c | |
parent | 48cfff3fbec9be3a9b7bd6e654812ad58a67d1d1 (diff) | |
download | uclient-a4e49b4163b28b2d12e718e66c4fcba87acef33e.tar.gz |
Fix unused results warnings
Fixes:
uclient-http.c:385:8: error: ignoring return value of 'fread', declared with attribute warn_unused_result [-Werror=unused-result]
fread(&val, sizeof(val), 1, f);
^
uclient-fetch.c: In function 'main':
uclient-fetch.c:664:12: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Werror=unused-result]
asprintf(&auth_str, "%s:%s", username, password);
^
uclient-fetch.c: In function 'read_data_cb':
uclient-fetch.c:269:9: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
write(output_fd, buf, len);
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'uclient-http.c')
-rw-r--r-- | uclient-http.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/uclient-http.c b/uclient-http.c index 8d26bd4..ac9d50f 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -379,11 +379,14 @@ get_cnonce(char *dest) { uint32_t val = 0; FILE *f; + size_t n; f = fopen("/dev/urandom", "r"); if (f) { - fread(&val, sizeof(val), 1, f); + n = fread(&val, sizeof(val), 1, f); fclose(f); + if (n != 1) + return; } bin_to_hex(dest, &val, sizeof(val)); |