aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_download.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-04 11:24:44 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-04 11:24:44 +0000
commitd80f189a015e725346e0c8509a83ccb33f7eee60 (patch)
tree4c027460e76abf05f0a31050d22afe31d8137e02 /src/fs/fs_download.c
parent2764fd265cdf18522c3d852057bbdbd947072e17 (diff)
-allow NULL for emsg
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r--src/fs/fs_download.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index d91c9e8244..8ae4a29fb5 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -1773,16 +1773,19 @@ fh_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
struct GNUNET_DISK_FileHandle *fh = dc->rfh;
ssize_t ret;
- *emsg = NULL;
+ if (NULL != emsg)
+ *emsg = NULL;
if (offset != GNUNET_DISK_file_seek (fh, offset, GNUNET_DISK_SEEK_SET))
{
- *emsg = GNUNET_strdup (strerror (errno));
+ if (NULL != emsg)
+ *emsg = GNUNET_strdup (strerror (errno));
return 0;
}
ret = GNUNET_DISK_file_read (fh, buf, max);
if (ret < 0)
{
- *emsg = GNUNET_strdup (strerror (errno));
+ if (NULL != emsg)
+ *emsg = GNUNET_strdup (strerror (errno));
return 0;
}
return ret;